/* ===========================
   CSS VARIABLES & RESET
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #10b981;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --accent: #8b5cf6;
    --navbar-bg: #ffffff;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #10b981 100%);
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --navbar-bg: #111827;
    --code-bg: #0f172a;
    --code-text: #cbd5e1;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* ===========================
   HERO SECTION
   =========================== */

.hero {
    background: var(--gradient);
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--border);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-para {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stats span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .hero {
    background: linear-gradient(to right, #111827, #1f2937);
}

[data-theme="dark"] .hero-para {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-h1 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-stats span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 1px solid #7c3aed;
}

/* ===========================
   MAIN CONTAINER
   =========================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ===========================
   GAME STATS CARDS
   =========================== */

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--gradient);
    color: white;
    padding: 20px 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    min-width: 150px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ===========================
   GAME AREA
   =========================== */

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.column {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 2px solid var(--border);
    min-height: 600px;
    box-shadow: 0 4px 20px var(--shadow);
}

.column-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drop-zone {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    min-height: 90px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.drop-zone.drag-over {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    border-style: solid;
    transform: scale(1.02);
}

.drop-zone-number {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.drop-zone-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.95rem;
}

/* ===========================
   CLAUSE CARDS
   =========================== */

.clause-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
    width: 100%;
}

.clause-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-lg);
    border-color: var(--primary);
}

.clause-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg) scale(0.98);
}

.clause-card.in-place {
    cursor: pointer;
}

.clause-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clause-name i {
    color: var(--primary);
    font-size: 1rem;
}

.clause-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===========================
   ACTION BUTTONS
   =========================== */

.controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.action-buttons button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-buttons button:hover::before {
    width: 300px;
    height: 300px;
}

.action-buttons button span {
    position: relative;
    z-index: 1;
}

.btn-check {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-check:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-hint {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.btn-hint:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
}

.btn-reset {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 2px solid var(--error);
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* ===========================
   HINT TEXT
   =========================== */

.hint-text {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: center;
    display: none;
    animation: slideDown 0.4s ease;
}

.hint-text.show {
    display: block;
}

.hint-text i {
    color: var(--warning);
    margin-right: 8px;
}

/* ===========================
   DROP ZONE STATES
   =========================== */

.drop-zone.correct {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    animation: correctPulse 0.5s ease;
}

.drop-zone.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===========================
   RESULT MODAL
   =========================== */

.result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.result-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-content {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px var(--shadow-lg);
    border: 2px solid var(--border);
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.result-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.result-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.result-content .btn-check {
    padding: 14px 40px;
    font-size: 1.1rem;
    border: none;
    margin: 0 auto;
}

/* ===========================
   NOTIFICATION
   =========================== */

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    background: var(--gradient);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transform: translateX(400px);
    transition: transform 0.4s ease;
    z-index: 1000;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 968px) {
    .game-area {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-para {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stats span {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .game-stats {
        gap: 15px;
    }

    .stat-card {
        padding: 15px 20px;
        min-width: 120px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-settings-buttons {
        flex-direction: column;
    }

    .cookie-settings-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .column {
        padding: 16px;
        min-height: 500px;
    }

    .column-title {
        font-size: 1.1rem;
    }

    .clause-card {
        padding: 12px;
    }

    .clause-name {
        font-size: 1rem;
    }

    .clause-description {
        font-size: 0.8rem;
    }

    .drop-zone {
        padding: 12px;
        min-height: 70px;
    }

    .drop-zone-number {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .notification {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        transform: translateY(-100px);
        top: 70px;
    }

    .notification.show {
        transform: translateY(0);
    }

    .result-content {
        padding: 30px 20px;
    }

    .result-icon {
        font-size: 4rem;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .result-message {
        font-size: 1rem;
    }
}