/**
 * Frontend Styles for Formulier Aanmeld Limiet
 */

/* Base styles for plugin elements */
.fal-frontend-element {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Counter styles */
.fal-counter {
    background: #f0f8ff;
    border: 1px solid #d1ecf1;
    color: #0c5460;
}

.fal-counter p {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

/* Limit reached message styles */
.fal-limit-reached {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.fal-limit-reached p {
    margin: 0;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.4;
}

/* Hide form when limit is reached */
.fal-limit-reached + .elementor-form,
.fal-limit-reached + form {
    display: none !important;
}

/* Loading state */
.fal-frontend-element.fal-loading {
    opacity: 0.7;
    position: relative;
    pointer-events: none;
}

.fal-frontend-element.fal-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: fal-spin 1s infinite linear;
    z-index: 10;
}

@keyframes fal-spin {
    to { transform: rotate(360deg); }
}

/* Status indicators */
.fal-status-open {
    color: #28a745 !important;
    font-weight: bold;
}

.fal-status-full {
    color: #dc3545 !important;
    font-weight: bold;
}

/* Shortcode styles */
.fal-info-simple,
.fal-info-default,
.fal-info-detailed {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    margin: 5px 0;
}

.fal-info-detailed {
    display: block;
    padding: 15px;
}

.fal-info-detailed h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

/* Progress bars */
.fal-progress-container {
    margin: 10px 0;
}

.fal-progress-text {
    font-size: 14px;
    margin-bottom: 5px;
    color: #666;
}

.fal-progress-bar {
    background: #f0f0f1;
    border-radius: 10px;
    overflow: hidden;
    height: 20px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.fal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #2271b1);
    transition: width 0.3s ease;
    position: relative;
}

.fal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 25%, 
        rgba(255,255,255,0.1) 25%, 
        rgba(255,255,255,0.1) 50%, 
        transparent 50%, 
        transparent 75%, 
        rgba(255,255,255,0.1) 75%
    );
    background-size: 20px 20px;
    animation: fal-progress-stripes 1s linear infinite;
}

@keyframes fal-progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* List templates */
.fal-lijst-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.fal-card {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.fal-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.fal-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.fal-lijst-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.fal-lijst-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    margin-bottom: 5px;
    border-radius: 4px;
}

.fal-lijst-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fal-lijst-table th,
.fal-lijst-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: left;
}

.fal-lijst-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.fal-lijst-table tr:nth-child(even) {
    background: #f8f9fa;
}

.fal-lijst-table tr:hover {
    background: #e9ecef;
}

/* Refresh button */
.fal-refresh-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.fal-refresh-btn:hover {
    background: #135e96;
}

/* Responsive design */
@media (max-width: 768px) {
    .fal-frontend-element {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .fal-frontend-element p {
        font-size: 13px;
    }
    
    .fal-lijst-cards {
        grid-template-columns: 1fr;
    }
    
    .fal-lijst-table {
        font-size: 14px;
    }
    
    .fal-lijst-table th,
    .fal-lijst-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .fal-frontend-element {
        padding: 10px;
        font-size: 12px;
    }
    
    .fal-progress-bar {
        height: 15px;
    }
    
    .fal-lijst-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Print styles */
@media print {
    .fal-frontend-element {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
    }
    
    .fal-refresh-btn {
        display: none;
    }
    
    .fal-progress-fill::after {
        display: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .fal-counter {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    .fal-limit-reached {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    .fal-progress-fill {
        background: #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fal-frontend-element,
    .fal-progress-fill,
    .fal-card {
        transition: none;
    }
    
    .fal-progress-fill::after {
        animation: none;
    }
    
    .fal-frontend-element.fal-loading::after {
        animation: none;
    }
}

