/* style.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --illegal-color: #8e44ad;
    --background-color: #f5f5f5;
    --text-color: #333;
    --panel-bg: white;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

[data-theme="dark"] {
    --primary-color: #34495e;
    --secondary-color: #2980b9;
    --accent-color: #c0392b;
    --light-color: #2c3e50;
    --dark-color: #ecf0f1;
    --success-color: #27ae60;
    --warning-color: #d35400;
    --danger-color: #c0392b;
    --illegal-color: #9b59b6;
    --background-color: #1a1a1a;
    --text-color: #ecf0f1;
    --panel-bg: #2c3e50;
    --shadow: 0 2px 5px rgba(0,0,0,0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 10px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

#theme-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

#theme-button:hover {
    background: rgba(255,255,255,0.3);
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .game-area {
        flex-direction: row;
    }
}

.stats-panel, .actions-panel, .story-panel {
    background-color: var(--panel-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.1);
}

.stats-panel {
    flex: 1;
}

.actions-panel {
    flex: 2;
}

.story-panel {
    flex: 1;
}

.panel-title {
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title::before {
    content: "▶";
    color: var(--secondary-color);
    font-size: 0.8em;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, var(--light-color), rgba(255,255,255,0.8));
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.stat-value {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.action-button {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.action-button:hover::before {
    left: 100%;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.action-button:active {
    transform: translateY(0);
}

.action-button:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-button:disabled::before {
    display: none;
}

.action-button.illegal {
    background: linear-gradient(135deg, var(--illegal-color), #732d91);
    border: 1px solid rgba(255,255,255,0.2);
}

.action-button.illegal:hover {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.action-cost {
    font-size: 0.85rem;
    color: var(--warning-color);
    margin: -8px 0 15px 0;
    padding-left: 10px;
    font-style: italic;
}

.warning-text {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.story-content {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--light-color);
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) var(--light-color);
}

.story-content::-webkit-scrollbar {
    width: 6px;
}

.story-content::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 3px;
}

.story-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.story-message {
    margin-bottom: 12px;
    padding: 10px;
    border-left: 4px solid var(--secondary-color);
    background: var(--panel-bg);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.control-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.save-button {
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    color: white;
}

.save-button:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-2px);
}

.reset-button {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
}

.reset-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--light-color), rgba(255,255,255,0.8));
    border-radius: 6px;
    border-left: 4px solid var(--success-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upgrade-info {
    flex: 2;
}

.upgrade-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.upgrade-description {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.upgrade-cost {
    flex: 1;
    text-align: right;
    color: var(--warning-color);
    font-weight: bold;
    font-size: 1rem;
}

.upgrade-button {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.upgrade-button:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-1px);
}

.upgrade-button:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    font-weight: bold;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.tab-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--light-color);
    flex-wrap: wrap;
    gap: 5px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 6px 6px 0 0;
    color: var(--text-color);
    opacity: 0.7;
}

.tab:hover {
    background: var(--light-color);
    opacity: 1;
}

.tab.active {
    border-bottom: 3px solid var(--secondary-color);
    color: var(--secondary-color);
    opacity: 1;
    background: var(--light-color);
}

.tab-content {
    display: none;
    padding: 20px 0;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .theme-toggle {
        position: static;
        margin-top: 10px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border-radius: 6px;
        margin-bottom: 5px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .tab.active {
        border-left: 3px solid var(--secondary-color);
        border-bottom: none;
    }
}

/* Animation for illegal actions */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.illegal-shake {
    animation: shake 0.5s ease;
}

/* Police caught animation */
.police-caught {
    background: linear-gradient(135deg, var(--danger-color), #c0392b) !important;
    color: white !important;
    animation: policeFlash 1s ease infinite;
}

@keyframes policeFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Success animation */
.success-animation {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}