/* Shadowrun Lifestyle Generator - Styles */

:root {
    /* Shadowrun-inspired color palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #242433;

    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;

    --accent-primary: #00d4ff;
    --accent-secondary: #ff6b35;
    --accent-success: #00ff88;
    --accent-warning: #ffcc00;
    --accent-danger: #ff3366;

    --border-color: #333344;
    --border-highlight: #00d4ff40;

    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Consolas', 'Monaco', monospace;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-bottom: 2px solid var(--accent-primary);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-primary);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.card h2 {
    color: var(--accent-primary);
    font-size: 1.4rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card.highlight {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--border-highlight);
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Location Selector */
.location-selector {
    margin-bottom: 20px;
}

.region-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.region-tab {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.region-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.region-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.location-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.location-item {
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.location-item.selected {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.location-item .location-item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.location-item .location-item-meta {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Location Details */
.location-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
}

.location-details h3 {
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.location-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.area-badge, .cost-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.area-badge {
    background: var(--accent-secondary);
    color: var(--bg-primary);
}

.cost-badge {
    background: var(--accent-warning);
    color: var(--bg-primary);
}

.location-residents {
    color: var(--text-secondary);
    font-style: italic;
    margin: 10px 0;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 4px;
}

.adventure-hooks {
    margin-top: 15px;
}

.adventure-hooks h4 {
    color: var(--accent-success);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.adventure-hooks ul {
    list-style: none;
    padding-left: 0;
}

.adventure-hooks li {
    padding: 5px 0 5px 20px;
    position: relative;
    color: var(--text-secondary);
}

.adventure-hooks li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-success);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.category-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
}

.category-box h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 5px;
}

.category-box .category-description {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.category-box select {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.category-box select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.category-box select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.category-box .option-description {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 60px;
}

.category-box .points-badge {
    display: inline-block;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
}

/* Points Summary */
.points-summary {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.points-display, .lifestyle-display {
    text-align: center;
}

.points-summary .label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.points-summary .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.lifestyle-display .value {
    color: var(--accent-success);
}

/* Edges and Flaws */
.edges-flaws-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .edges-flaws-container {
        grid-template-columns: 1fr;
    }
}

.edges-column h3, .flaws-column h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.modifier-label {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-muted);
}

.modifier-list {
    max-height: 400px;
    overflow-y: auto;
}

.modifier-item {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modifier-item:hover:not(.disabled) {
    border-color: var(--accent-primary);
}

.modifier-item.selected {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.modifier-item.selected .modifier-cost {
    color: var(--bg-primary);
}

.modifier-item.auto {
    background: var(--bg-hover);
    border-color: var(--accent-warning);
}

.modifier-item.auto::after {
    content: 'AUTO';
    font-size: 0.7rem;
    background: var(--accent-warning);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}

.modifier-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modifier-item input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.modifier-info {
    flex: 1;
}

.modifier-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.modifier-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modifier-item.selected .modifier-description {
    color: var(--bg-secondary);
}

.modifier-cost {
    font-weight: 600;
    color: var(--accent-primary);
    margin-left: 10px;
    white-space: nowrap;
}

.edges-column .modifier-cost {
    color: var(--accent-danger);
}

.flaws-column .modifier-cost {
    color: var(--accent-success);
}

/* Conflicts */
.conflicts {
    margin-top: 20px;
    padding: 15px;
    background: var(--accent-danger);
    border-radius: 6px;
    color: white;
}

.conflicts h4 {
    margin-bottom: 10px;
}

.conflicts ul {
    list-style: none;
    padding-left: 0;
}

.conflicts li {
    padding: 5px 0;
}

/* Cost Breakdown */
.cost-breakdown {
    max-width: 500px;
    margin: 0 auto;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cost-row.total {
    border-bottom: none;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 2px solid var(--accent-primary);
}

.cost-label {
    color: var(--text-secondary);
}

.cost-value {
    font-weight: 600;
    font-family: var(--font-mono);
}

.cost-row.total .cost-label,
.cost-row.total .cost-value {
    font-size: 1.3rem;
    color: var(--accent-primary);
}

/* Description Section */
.description-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.description-header label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.description-header input {
    flex: 1;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
}

.description-header input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.description-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    min-height: 200px;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.8;
}

.description-content .placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

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

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #00b8e6;
    box-shadow: 0 0 15px var(--accent-primary);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--accent-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow: auto;
}

.modal-body textarea {
    width: 100%;
    height: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 15px;
    resize: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

footer p {
    margin: 5px 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

    .points-summary {
        flex-direction: column;
        gap: 20px;
    }

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

    .btn {
        width: 100%;
    }
}
