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

:root {
    /* EVIC Brand Colors */
    --primary-navy: #1A3B52;
    --primary-orange: #E85D04;
    --secondary-orange: #FF7D00;
    --light-navy: #2D5A78;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --dark-text: #333;
    --light-text: #999;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-navy) 0%, #0f2438 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--primary-orange);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

header h1 {
    font-size: 2.5em;
    color: var(--primary-navy);
    margin: 0;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    color: var(--light-text);
    margin: 0;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary-orange);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-orange);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(232, 93, 4, 0.3);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--primary-navy);
    border: 2px solid var(--primary-navy);
}

.btn-secondary:hover {
    background: var(--primary-navy);
    color: white;
    border-color: var(--primary-navy);
    transform: translateY(-2px);
}

.btn-danger {
    background: #cc0000;
    color: white;
}

.btn-danger:hover {
    background: #990000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(204, 0, 0, 0.3);
}

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

/* Decks Container */
.decks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

/* Responsive: 2 columns on tablets */
@media (max-width: 1000px) {
    .decks-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 600px) {
    .decks-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.deck-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.deck-section h2 {
    font-size: 1.5em;
    color: var(--primary-navy);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Card Deck Styling */
.deck {
    width: 100%;
    max-width: 240px;
    height: 320px;
    cursor: pointer;
    perspective: 1000px;
    margin: 0 auto 15px auto;
}

.deck-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.deck.flipped .deck-inner {
    transform: rotateY(180deg);
}

.deck-back,
.deck-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.deck-back {
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--light-navy) 100%);
    color: white;
    font-size: 1.2em;
    border: 3px solid var(--primary-orange);
}

.deck-front {
    background: var(--light-gray);
    color: var(--dark-text);
    font-size: 1em;
    line-height: 1.6;
    transform: rotateY(180deg);
    border: 3px solid var(--border-gray);
    overflow-y: auto;
}

.card-content {
    padding: 10px;
}

.card-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary-navy);
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-description {
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}

.deck:hover .deck-back {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    box-shadow: 0 12px 24px rgba(232, 93, 4, 0.3);
}

.deck-info {
    font-size: 0.9em;
    color: var(--light-text);
    text-align: center;
}

.deck-info.drawn {
    color: var(--primary-orange);
    font-weight: 600;
}

/* Scenario Summary */
.scenario-summary {
    background: var(--light-gray);
    border-left: 5px solid var(--primary-orange);
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.scenario-summary h2 {
    color: var(--primary-navy);
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.scenario-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-orange);
}

.summary-item strong {
    color: var(--primary-navy);
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.summary-item p {
    color: #555;
    line-height: 1.6;
    font-size: 0.95em;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.summary-item p:only-child {
    font-style: italic;
    color: var(--light-text);
}

/* Scrollbar styling for cards */
.deck-front::-webkit-scrollbar {
    width: 6px;
}

.deck-front::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.deck-front::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 10px;
}

.deck-front::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-orange);
}

/* Drawers Section */
.drawers-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border-gray);
}

.drawers-section h2 {
    color: var(--primary-navy);
    margin-bottom: 0;
    font-size: 1.5em;
    font-weight: 600;
}

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

.drawers-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.drawers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.drawer {
    background: white;
    border: 2px solid var(--border-gray);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.drawer:hover {
    border-color: var(--primary-orange);
    box-shadow: 0 6px 16px rgba(232, 93, 4, 0.15);
    transform: translateY(-2px);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-gray);
}

.drawer-number {
    background: var(--primary-navy);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.drawer-date {
    font-size: 0.85em;
    color: var(--light-text);
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.drawer-card {
    background: var(--light-gray);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-orange);
}

.drawer-card strong {
    color: var(--primary-navy);
    display: block;
    font-size: 0.9em;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drawer-card p {
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
}

.drawer-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.drawer-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--primary-navy);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--primary-navy);
}

.drawer-btn:hover {
    background: var(--primary-navy);
    color: white;
}

.drawer-btn.delete:hover {
    background: #cc0000;
    border-color: #cc0000;
    color: white;
}

.drawer-count {
    text-align: center;
    color: var(--light-text);
    font-size: 0.95em;
    padding: 10px;
    background: var(--light-gray);
    border-radius: 6px;
    margin: 0;
}

.empty-drawers {
    text-align: center;
    padding: 40px 20px;
    color: var(--light-text);
}

.empty-drawers p {
    font-size: 1.1em;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header-content {
        gap: 15px;
    }

    .logo {
        height: 60px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .decks-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .deck {
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .summary-content {
        grid-template-columns: 1fr;
    }

    .drawers-container {
        grid-template-columns: 1fr;
    }

    .drawer-actions {
        flex-direction: column;
    }

    .drawer-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .logo {
        height: 50px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.95em;
    }

    header {
        padding-bottom: 20px;
        margin-bottom: 25px;
    }
}

/* Animation for card draw */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.deck-front {
    animation: slideIn 0.6s ease;
}

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

.drawer {
    animation: fadeIn 0.3s ease;
}

/* Compatibility Warning Banner */
.warning-banner {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0 30px 0;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.warning-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
    min-width: 250px;
}

.warning-text strong {
    display: block;
    font-size: 1.2em;
    color: #856404;
    margin-bottom: 8px;
}

.warning-text p {
    color: #856404;
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
}

.warning-action {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.warning-action .btn {
    padding: 10px 20px;
    font-size: 0.95em;
}

/* Responsive warning banner */
@media (max-width: 768px) {
    .warning-banner {
        margin: 20px 0;
        padding: 15px;
    }
    
    .warning-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .warning-icon {
        align-self: center;
    }
    
    .warning-action {
        width: 100%;
    }
    
    .warning-action .btn {
        flex: 1;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
    }

    .controls,
    .scenario-actions {
        display: none;
    }
}
