/* Call of Cthulhu Character Creator - Dark Theme */

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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #444;
    margin-bottom: 20px;
}

.header h1 {
    color: #c9a96e;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.header p {
    color: #999;
    font-style: italic;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: #333;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    margin-bottom: 0;
}

.nav-tab {
    flex: 1;
    background: #333;
    border: none;
    color: #ccc;
    padding: 15px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    transition: all 0.3s ease;
    border-right: 1px solid #555;
}

.nav-tab:last-child {
    border-right: none;
}

.nav-tab:hover {
    background: #404040;
    color: #fff;
}

.nav-tab.active {
    background: #c9a96e;
    color: #1a1a1a;
    font-weight: bold;
}

.nav-tab:disabled {
    background: #222;
    color: #666;
    cursor: not-allowed;
}

/* Content Areas */
.content {
    background: #2a2a2a;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    min-height: 500px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Buttons */
.btn {
    background: #c9a96e;
    color: #1a1a1a;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn:hover {
    background: #d4b773;
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: #555;
    color: #fff;
}

.btn-secondary:hover {
    background: #666;
}

.btn-danger {
    background: #cc4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dd5555;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #c9a96e;
    transform: translateY(-2px);
}

.stat-label {
    color: #c9a96e;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
}

.stat-reduced {
    color: #cc4444;
    text-decoration: line-through;
}

.stat-original {
    color: #666;
    font-size: 18px;
    margin-left: 10px;
}

/* Age Controls */
.age-section {
    background: #333;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.age-slider {
    width: 100%;
    margin: 10px 0;
}

.age-slider input[type="range"] {
    width: 100%;
    height: 8px;
    background: #555;
    border-radius: 4px;
    outline: none;
}

.age-reduction {
    margin-top: 15px;
    display: none;
}

.age-reduction.visible {
    display: block;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Occupation Cards */
.occupation-filters {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filter-btn {
    background: #444;
    color: #ccc;
    border: 1px solid #666;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #555;
    border-color: #c9a96e;
}

.filter-btn.active {
    background: #c9a96e;
    color: #1a1a1a;
    border-color: #c9a96e;
}

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

.occupation-card {
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.occupation-card:hover {
    border-color: #c9a96e;
    transform: translateY(-2px);
}

.occupation-card.selected {
    border-color: #c9a96e;
    background: #3a3a3a;
}

.occupation-title {
    color: #c9a96e;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.occupation-details {
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
}

.occupation-tags {
    margin: 10px 0;
}

.tag {
    background: #555;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    display: inline-block;
}

/* Skill Grid */
.skill-section {
    margin: 20px 0;
}

.skill-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.budget-display {
    background: #333;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.budget-item {
    color: #ccc;
}

.budget-positive {
    color: #4CAF50;
}

.budget-negative {
    color: #f44336;
}

.skills-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #333;
    border-radius: 8px;
    overflow: hidden;
}

.skills-table th,
.skills-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #555;
}

.skills-table th {
    background: #444;
    color: #c9a96e;
    font-weight: bold;
}

.skills-table tr:hover {
    background: #3a3a3a;
}

.skill-input {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    width: 60px;
    text-align: center;
}

.skill-input:focus {
    outline: none;
    border-color: #c9a96e;
}

.skill-input:disabled {
    background: #1a1a1a;
    color: #666;
}

/* Form Elements */
.form-group {
    margin: 15px 0;
}

.form-label {
    display: block;
    color: #c9a96e;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-input {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #c9a96e;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.dashboard-card {
    background: #333;
    border-radius: 8px;
    padding: 20px;
}

.dashboard-card h3 {
    color: #c9a96e;
    margin-bottom: 15px;
}

.resource-tracker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 5px;
}

.resource-controls {
    display: flex;
    gap: 5px;
}

.resource-btn {
    background: #555;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-btn:hover {
    background: #666;
}

.skill-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.skill-check-btn {
    background: #444;
    color: #ccc;
    border: 1px solid #666;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
}

.skill-check-btn:hover {
    background: #555;
    border-color: #c9a96e;
}

/* Roll Results */
.roll-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border: 2px solid #c9a96e;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    z-index: 1000;
    min-width: 300px;
}

.roll-result.success {
    border-color: #4CAF50;
}

.roll-result.failure {
    border-color: #f44336;
}

.roll-result.critical {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.roll-result.fumble {
    border-color: #8B0000;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .occupations-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .budget-display {
        flex-direction: column;
    }
    
    .skill-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .occupation-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        text-align: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #c9a96e;
}

.loading::after {
    content: "⏳";
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

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