/**
 * @package     NVSP.Component
 * @subpackage  com_sloganhunt
 *
 * @copyright   (C) 2025 NVSP. All rights reserved.
 * @license     GNU General Public License version 3 or later
 * @version     1.0.1 - FIX: Groene button class toegevoegd (.btn-success)
 */

/* ========================================
   NVSP Sloganhunt - Site Styling
   ======================================== */

/* Color Palette */
:root {
    --nvsp-primary: #003D7A;
    --nvsp-secondary: #FF6B35;
    --nvsp-accent: #F7931E;
    --nvsp-success: #28a745;
    --nvsp-warning: #ffc107;
    --nvsp-danger: #dc3545;
    --nvsp-info: #17a2b8;
    --nvsp-light: #f8f9fa;
    --nvsp-dark: #343a40;
    --nvsp-bg-light: #FFF5F0;
}

/* ========================================
   Global Styles
   ======================================== */

.sloganhunt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sloganhunt-section {
    margin-bottom: 40px;
}

/* ========================================
   Hero Section
   ======================================== */

.sloganhunt-hero {
    background: linear-gradient(135deg, var(--nvsp-primary) 0%, #004d99 100%);
    color: white;
    padding: 60px 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 6px 20px rgba(0, 61, 122, 0.25);
    position: relative;
    overflow: hidden;
}

.sloganhunt-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.sloganhunt-hero-content {
    position: relative;
    z-index: 1;
}

.sloganhunt-hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sloganhunt-hero .lead {
    font-size: 20px;
    margin: 0 0 30px 0;
    opacity: 0.95;
}

.hero-badge {
    display: inline-block;
    margin: 20px 0;
}

.hero-badge img {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

/* ========================================
   Registration Form
   ======================================== */

.registration-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.registration-card h2 {
    color: var(--nvsp-primary);
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.registration-card .subtitle {
    color: #6c757d;
    margin: 0 0 30px 0;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--nvsp-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--nvsp-secondary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control.is-invalid {
    border-color: var(--nvsp-danger);
}

.invalid-feedback {
    color: var(--nvsp-danger);
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.form-text {
    color: #6c757d;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* ========================================
   Buttons
   ======================================== */

/* ORANJE BUTTON - Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--nvsp-secondary) 0%, var(--nvsp-accent) 100%);
    border: none;
    color: white;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    color: white !important;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* GROENE BUTTON - Success */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    border: none;
    color: white;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* GRIJZE BUTTON - Secondary */
.btn-secondary {
    background: #6c757d;
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* ========================================
   Progress Display
   ======================================== */

.progress-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.progress-header h2 {
    color: var(--nvsp-primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.code-display {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5e1 100%);
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid var(--nvsp-accent);
}

.code-label {
    font-size: 12px;
    color: #856404;
    margin: 0;
    font-weight: 600;
}

.code-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--nvsp-secondary);
    margin: 0;
    letter-spacing: 1px;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: var(--nvsp-bg-light);
    border-radius: 12px;
    border: 2px solid #ffe0d5;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--nvsp-secondary);
    margin: 0;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin: 5px 0 0 0;
    font-weight: 600;
}

.progress-bar-container {
    margin: 30px 0;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--nvsp-dark);
}

.progress-bar-wrapper {
    background: #e9ecef;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--nvsp-success) 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    transition: width 0.8s ease;
    border-radius: 20px;
}

.progress-bar-fill.incomplete {
    background: linear-gradient(90deg, var(--nvsp-warning) 0%, #ffb347 100%);
}

/* ========================================
   Letters Grid
   ======================================== */

.letters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.letter-box {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.letter-box:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.letter-box.found {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: var(--nvsp-success);
    animation: foundAnimation 0.5s ease;
}

@keyframes foundAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1); }
}

.letter-box.missing {
    background: #f8f9fa;
    border-style: dashed;
    cursor: default;
}

.letter-char {
    font-size: 32px;
    font-weight: 700;
    color: var(--nvsp-secondary);
    margin: 0;
}

.letter-box.missing .letter-char {
    color: #adb5bd;
}

.letter-position {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--nvsp-accent);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-word {
    font-size: 10px;
    color: #6c757d;
    margin-top: 5px;
    text-transform: uppercase;
}

/* ========================================
   Submission Form
   ======================================== */

.submission-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.submission-card h2 {
    color: var(--nvsp-primary);
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.slogan-input-container {
    position: relative;
    margin: 30px 0;
}

.slogan-input {
    width: 100%;
    padding: 20px;
    border: 3px solid var(--nvsp-secondary);
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.slogan-input:focus {
    outline: none;
    border-color: var(--nvsp-accent);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}

.char-count {
    text-align: right;
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
}

.completion-badge {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid var(--nvsp-success);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.completion-badge .icon {
    font-size: 48px;
    color: var(--nvsp-success);
    margin-bottom: 10px;
}

.completion-badge h3 {
    color: #155724;
    margin: 0 0 5px 0;
    font-size: 22px;
    font-weight: 700;
}

.completion-badge p {
    color: #155724;
    margin: 0;
    font-size: 14px;
}

/* ========================================
   Alert Messages
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    font-size: 20px;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left-color: var(--nvsp-success);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left-color: var(--nvsp-info);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left-color: var(--nvsp-warning);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left-color: var(--nvsp-danger);
}

/* ========================================
   Instructions
   ======================================== */

.instructions-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.instructions-card h3 {
    color: var(--nvsp-primary);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.instructions-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 50px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--nvsp-dark);
}

.instructions-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--nvsp-secondary) 0%, var(--nvsp-accent) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

/* ========================================
   Loading States
   ======================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.loading-content .loading-spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
    border-top-color: var(--nvsp-secondary);
    border-right-color: var(--nvsp-secondary);
    margin-bottom: 15px;
}

/* ========================================
   Empty States
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--nvsp-dark);
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.empty-state p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .sloganhunt-container {
        padding: 15px;
    }

    .sloganhunt-hero {
        padding: 40px 20px;
    }

    .sloganhunt-hero h1 {
        font-size: 28px;
    }

    .sloganhunt-hero .lead {
        font-size: 16px;
    }

    .registration-card,
    .submission-card {
        padding: 25px;
    }

    .progress-header {
        flex-direction: column;
        gap: 15px;
    }

    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .letters-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }

    .letter-char {
        font-size: 24px;
    }

    .slogan-input {
        font-size: 16px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .progress-stats {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 28px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .btn,
    .form-control,
    .alert {
        display: none !important;
    }

    .sloganhunt-hero {
        background: white;
        color: var(--nvsp-primary);
        box-shadow: none;
        border: 2px solid var(--nvsp-primary);
    }
}
