/* Стилове за competitions.php. Изнесени от inline <style>, за да се кешират. */

        .competitions-hero {
            background: linear-gradient(180deg, #2E5AAC 0%, #4B8BF5 100%);
            color: #1A365D;
            padding: 0.2rem 0;
            text-align: center;
            position: relative;
        }

        .competitions-hero h1 {
            font-size: 3rem;
            font-weight: 700;
            margin-bottom: 0.3rem;
            color: var(--primary-blue);
            text-shadow:
                -1px -1px 0 white,
                1px -1px 0 white,
                -1px 1px 0 white,
                1px 1px 0 white;
        }

        .competitions-hero p {
            font-size: 1.25rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto;
            font-weight: bold;
            color: white;
        }

        .medal-display {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin: 15px 0 10px 0;
        }

        .competitions-image {
            position: absolute;
            left: 200px;
            top: 53%;
            transform: translateY(-50%);
            width: 320px;
            height: 320px;
            object-fit: contain;
            max-width: 25vw;
            max-height: 25vw;
        }

        .medal {
            font-size: 4rem;
            animation: bounce 2s infinite;
        }

        .medal:nth-child(2) {
            animation-delay: 0.3s;
        }

        .medal:nth-child(3) {
            animation-delay: 0.6s;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }

        .results-section {
            background: #f8fafc;
        }

        .results-table {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
            max-width: 800px;
            margin: 0 auto;
        }

        .table-header {
            background: #1e40af;
            color: white;
            padding: 1.5rem;
            text-align: center;
        }

        .results-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .result-item {
            padding: 1.5rem;
            border-bottom: 1px solid #f1f5f9;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: background-color 0.3s ease;
        }

        .result-item:hover {
            background: #f8fafc;
        }

        .result-item:last-child {
            border-bottom: none;
        }

        .medal-icon {
            font-size: 1.5rem;
            margin-right: 1rem;
        }

        .stats-section {
            padding: 3rem 0;
            background: #f8fafc;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 2rem;
            margin-top: 2rem;
        }

        .stat-card {
            background: white;
            padding: 2rem;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            border-top: 4px solid #3b82f6;
        }

        .stat-number {
            font-size: 3rem;
            font-weight: 700;
            color: #1e40af;
            margin-bottom: 0.5rem;
        }

        .stat-label {
            color: #64748b;
            font-weight: 500;
        }

        .competitions-section {
            padding: 2rem 0;
            background: #f8fafc;
        }

        .section-header {
            margin-bottom: 1.5rem;
            text-align: center;
        }

        .section-title {
            font-size: 2.5rem;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 0.5rem;
            text-align: center;
            width: 100%;
            display: block;
        }

        .section-subtitle {
            font-size: 1.125rem;
            color: #64748b;
            text-align: left;
            max-width: 600px;
            margin: 0 auto;
        }

        .section-subtitle.enhanced {
            color: #1e40af !important;
            font-weight: 600 !important;
            font-size: 1.1rem !important;
            margin-top: 0.5rem !important;
            text-align: right !important;
            max-width: none !important;
            margin-left: auto !important;
            margin-right: 0 !important;
        }

        /* Copy exact footer styles from index.php */

/* Smooth scroll behavior */
        html {
            scroll-behavior: smooth;
        }

        .competitions-filters {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 3rem;
            flex-wrap: wrap;
        }

        .filter-button {
            padding: 0.75rem 1.5rem;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 25px;
            background: rgba(255, 255, 255, 0.9);
            color: #6b7280;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1),
                        inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }

        .filter-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s ease;
        }

        .filter-button:hover::before,
        .filter-button.active::before {
            left: 100%;
        }

        .filter-button:hover,
        .filter-button.active {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            border-color: rgba(255, 255, 255, 0.3);
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6),
                        0 8px 20px rgba(0, 0, 0, 0.2),
                        inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .competitions-grid {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2.5rem;
        }

        .competition-card {
            width: 100%;
            max-width: 860px;
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            border-top: 4px solid #3b82f6;
            position: relative;
        }

        .competition-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        }

        .competition-header {
            padding: 1.5rem;
            border-bottom: 1px solid #f1f5f9;
        }

        .competition-title {
            font-size: 1.75rem;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 0.75rem;
        }

        .competition-meta {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            flex-wrap: wrap;
        }

        .category-badge {
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
            color: white;
        }

        .status-badge {
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        @keyframes pulse-upcoming {
            0%, 100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
            }
            50% {
                transform: scale(1.08);
                box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
            }
        }

        .status-upcoming {
            background: #f59e0b;
            color: #fff;
            font-weight: 700;
            animation: pulse-upcoming 1.6s ease-in-out infinite;
        }

        .status-active {
            background: #dcfce7;
            color: #166534;
        }

        .status-completed {
            background: #e0e7ff;
            color: #3730a3;
        }

        .competition-content {
            padding: 1.5rem;
        }

        .competition-description {
            color: #64748b;
            line-height: 1.6;
            margin-bottom: 1rem;
        }
        .competition-description p {
            margin: 0 0 0.75rem;
        }
        .competition-description p:last-child {
            margin-bottom: 0;
        }
        .competition-description ul,
        .competition-description ol {
            margin: 0 0 0.75rem 1.5rem;
            padding: 0;
        }
        .competition-description li {
            margin-bottom: 0.25rem;
        }
        .competition-description h1,
        .competition-description h2,
        .competition-description h3 {
            margin: 0.5rem 0;
            font-weight: 700;
            color: #1e293b;
        }
        .competition-description strong,
        .competition-description b {
            font-weight: 700;
            color: #1e293b;
        }
        .competition-description blockquote {
            border-left: 3px solid #e2e8f0;
            padding-left: 1rem;
            margin: 0.5rem 0;
            font-style: italic;
        }
        .competition-description span[style] {
            display: inline;
        }
        .competition-description .ql-size-small { font-size: 0.85em; }
        .competition-description .ql-size-large { font-size: 1.5em; }
        .competition-description .ql-size-huge  { font-size: 2em; }

        .competition-details {
            display: grid;
            gap: 0.75rem;
        }

        .detail-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            color: #64748b;
        }

        .detail-icon {
            color: #3b82f6;
            font-weight: 600;
        }

        .competition-actions {
            padding: 1rem 1.5rem;
            background: #f8fafc;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .button-row {
            display: flex;
            gap: 1rem;
            width: 100%;
        }

        .button-row > .action-button,
        .button-row > button {
            flex: 1;
        }

        .button-wide {
            flex: 1 !important;
            width: 100%;
        }

        .action-button {
            flex: 1;
            padding: 0.75rem 1.5rem;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 25px;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4),
                        inset 0 1px 0 rgba(255, 255, 255, 0.2);
            min-height: 50px;
            font-family: inherit;
            font-size: inherit;
            line-height: 1.5;
        }

        /* Reset button default styles */
        button.action-button {
            margin: 0;
            box-sizing: border-box;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        .action-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s ease;
        }

        .action-button:hover::before {
            left: 100%;
        }

        .action-button:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6),
                        0 8px 20px rgba(0, 0, 0, 0.2),
                        inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .btn-primary {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4),
                        0 4px 12px rgba(0, 0, 0, 0.15),
                        inset 0 1px 0 rgba(255, 255, 255, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.1);
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s ease;
        }

        .btn-primary:hover::before {
            left: 100%;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #059669 0%, #10b981 100%);
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6),
                        0 8px 20px rgba(0, 0, 0, 0.2),
                        inset 0 1px 0 rgba(255, 255, 255, 0.3);
        }

        .btn-outline {
            background: white;
            color: #3b82f6;
            border: 1px solid #3b82f6;
        }

        .btn-outline:hover {
            background: #3b82f6;
            color: white;
        }

        .no-competitions {
            text-align: center;
            padding: 4rem 2rem;
            color: #64748b;
        }

        .no-competitions h3 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: #94a3b8;
        }

@media (max-width: 640px) {
            .competitions-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            .competition-card {
                max-width: 100%;
            }

            .competition-card--proleten {
                order: -1;
            }
        }

        @media (max-width: 1200px) {
            .competitions-image {
                left: 100px;
                width: 250px;
                height: 250px;
            }
        }

        @media (max-width: 900px) {
            .competitions-image {
                left: 50px;
                width: 200px;
                height: 200px;
            }
        }

        @media (max-width: 768px) {
            /* Fix hero section position on mobile */
            .competitions-hero {
                padding-top: 10px;
            }







/* Hide competitions image from hero on mobile */
            .competitions-image {
                display: none !important;
            }

            .competitions-hero h1 {
                font-size: 2rem;
            }

            /* Fix hero text for mobile */
            .competitions-hero p {
                white-space: normal !important;
                max-width: 100% !important;
                padding: 0 15px !important;
                font-size: 1rem !important;
                line-height: 1.4 !important;
            }

            /* Show mobile image section only on mobile */
            .mobile-image-section {
                display: block !important;
                background: #f8fafc !important;
            }

            /* Reduce section titles size for mobile */
            .section-title {
                font-size: 1.5rem !important;
            }

            /* Optimize stats cards for mobile */
            .stats-grid {
                grid-template-columns: 1fr 1fr !important;
                gap: 1rem !important;
                margin-top: 1.5rem !important;
            }

            .stat-card {
                padding: 1.2rem 0.8rem !important;
                border-radius: 10px !important;
            }

            .stat-number {
                font-size: 2rem !important;
                margin-bottom: 0.3rem !important;
            }

            .stat-label {
                font-size: 0.75rem !important;
                line-height: 1.2 !important;
            }

            .stats-section {
                padding: 2rem 0 !important;
            }

            .section-subtitle {
                font-size: 0.9rem !important;
            }

            /* Uniform size and center alignment for all section headers on mobile */
            h2.section-title,
            .section-header h2,
            #results .section-title,
            #results h2,
            #competitions .section-title,
            #competitions h2,
            #statistics .section-title,
            #statistics h2 {
                font-size: 1.4rem !important;
                line-height: 1.3 !important;
                margin-top: 15px !important;
                text-align: center !important;
            }

            /* Center align section headers */
            .section-header {
                text-align: center !important;
            }

            /* Force center alignment for specific sections */
            #statistics .section-header,
            #competitions .section-header {
                text-align: center !important;
            }

            #statistics .section-title,
            #competitions .section-title {
                text-align: center !important;
            }

            /* Most aggressive center alignment approach */
            .stats-section .section-title,
            .competitions-section .section-title {
                text-align: center !important;
                display: block !important;
                width: 100% !important;
                margin-left: auto !important;
                margin-right: auto !important;
            }

            /* Ultra specific selectors */
            h2[style*="color: var(--primary-blue)"] {
                text-align: center !important;
            }

            /* All h2 elements in mobile regardless */
            h2 {
                text-align: center !important;
                font-size: 1.4rem !important;
            }

            /* Ensure consistent size for all section titles */
            .competitions-section .section-title,
            .results-section h2,
            .stats-section .section-title {
                font-size: 1.4rem !important;
                text-align: center !important;
                line-height: 1.3 !important;
            }

            /* Hide section subtitles on mobile */
            #competitions .section-subtitle.enhanced,
            #statistics .section-subtitle.enhanced {
                display: none !important;
            }

            .medal-display {
                gap: 20px;
            }

            .medal {
                font-size: 3rem;
            }

            .competitions-grid {
                gap: 1.5rem;
            }

            .competitions-filters {
                justify-content: center;
            }

            .filter-button {
                font-size: 0.875rem;
                padding: 0.5rem 1rem;
            }

            /* Fix action buttons for mobile */
            .competition-actions {
                flex-direction: column;
                padding: 1rem;
                gap: 0.75rem;
            }

            .button-row {
                flex-direction: column;
                gap: 0.75rem;
            }

            .action-button {
                width: 100%;
                font-size: 0.875rem;
                padding: 0.6rem 1rem;
                min-height: 44px;
            }

            .action-button:hover {
                transform: none;
            }
        }

/* Results by grade expandable section */
    .results-toggle-btn {
        cursor: pointer;
        border: none;
        position: relative;
        transition: all 0.3s ease;
    }

    /* Active state for results toggle buttons */
    .results-toggle-btn.active {
        background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
        box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.3),
                    0 2px 10px rgba(5, 150, 105, 0.5) !important;
        transform: translateY(1px);
        border: 2px solid #065f46 !important;
    }

    .toggle-icon {
        display: inline-block;
        transition: transform 0.3s ease;
        font-size: 0.8em;
        margin-left: 0.25rem;
    }

    .toggle-icon.rotated {
        transform: rotate(180deg);
    }

    .results-by-grade {
        margin-top: 1rem;
        padding: 1rem 1rem 1.5rem 1rem;
        background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
        border-radius: 10px;
        border: 2px solid #10b981;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        animation: slideDown 0.3s ease-out;
    }

    .results-info-message {
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.6);
        border-left: 4px solid #059669;
        border-radius: 6px;
        margin-bottom: 0.25rem;
    }

    .results-info-message p {
        margin: 0;
        font-size: 0.9rem;
        line-height: 1.5;
        color: #065f46;
        font-weight: 500;
    }

    .results-info-message p::before {
        content: "ℹ️ ";
        margin-right: 0.5rem;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .grade-results-button {
        display: block;
        padding: 0.75rem 1.5rem;
        background: white;
        color: #059669;
        text-decoration: none;
        border-radius: 8px;
        border: 2px solid #10b981;
        font-weight: 600;
        text-align: center;
        transition: all 0.3s ease;
        box-shadow: 0 2px 5px rgba(16, 185, 129, 0.1);
    }

    .grade-results-button:hover {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

    @media (max-width: 768px) {
        .results-by-grade {
            padding: 0.75rem;
            gap: 0.5rem;
        }

        .results-info-message {
            padding: 0.65rem 0.75rem;
        }

        .results-info-message p {
            font-size: 0.85rem;
        }

        .grade-results-button {
            padding: 0.65rem 1rem;
            font-size: 0.9rem;
        }
    }

    /* Бавно мигане за ВАЖНО */
    @keyframes slowBlink {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.3; }
    }
    .blink-slow {
        animation: slowBlink 2s ease-in-out infinite;
    }
