/* Cyber Defence Character Sheet - Custom Styles */

/* Stat Grid Layout - Vertical Video Game Style */
.stat-grid {
    background: var(--background-secondary, #232425);
    border: 2px solid var(--border-color, #4e4e57);
    border-radius: var(--border-radius, 8px);
    padding: 20px;
    margin: 20px 0;
}

.stat-grid h3 {
    margin-top: 0;
    color: var(--accent-blue, #4a9eff);
    font-size: 1.2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--background-dark, #1a1a1a);
    border: 2px solid var(--border-color, #4e4e57);
    border-radius: 6px;
    padding: 0 8px;
    margin: 0 0 5px 0;
    height: 25px;
    min-height: 25px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-item:hover {
    border-color: var(--primary-color, #ff6b35);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.stat-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    line-height: 25px;
}

.stat-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    min-width: 80px;
    white-space: nowrap;
}

.stat-abbr {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary, #b3b3bd);
    text-transform: uppercase;
    background: var(--background-light, #2a2a2a);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 21px;
}

.stat-value {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
}

.stat-number {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-color, #ff6b35);
    min-width: 34px;
    text-align: center;
    background: var(--background-light, #2a2a2a);
    border: 2px solid var(--border-color, #4e4e57);
    border-radius: 6px;
    padding: 0 6px;
    line-height: 21px;
    text-shadow: none;
}

.stat-modifier {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-green, #5cb85c);
    min-width: 34px;
    text-align: center;
    line-height: 21px;
}

.stat-controls {
    display: flex;
    flex-direction: row-reverse;
    gap: 6px;
    align-items: center;
}

.stat-btn {
    width: 18px !important;
    height: 18px !important;
    font-size: 0.9rem;
    font-weight: 700;
    border: 2px solid var(--border-color, #4e4e57);
    border-radius: 4px;
    background: var(--background-light, #2a2a2a);
    color: var(--text-primary, #e0e0e0);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    line-height: 1;
}

.stat-btn:hover {
    background: var(--primary-color, #ff6b35);
    border-color: var(--primary-color, #ff6b35);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.35);
}

.stat-btn:active {
    transform: none;
}

.stat-btn.stat-plus,
.stat-btn.stat-minus {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
}

.stat-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Multi-select styling */
select[multiple] {
    padding: 10px;
    background: var(--background-secondary, #232425);
    border: 1px solid var(--border-color, #4e4e57);
    border-radius: var(--border-radius, 8px);
    color: var(--text-primary, #e0e0e0);
    min-height: 200px;
}

select[multiple] option {
    padding: 8px;
    border-radius: 4px;
    margin: 2px 0;
}

select[multiple] option:checked {
    background: linear-gradient(135deg, var(--primary-color, #ff6b35), var(--primary-dark, #e55a25));
    color: white;
}

select[multiple] optgroup {
    font-weight: bold;
    font-style: normal;
    color: var(--accent-blue, #4a9eff);
    margin-top: 8px;
}

/* Toggle Options */
.toggle-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.toggle-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--background-secondary, #232425);
    border: 2px solid var(--border-color, #4e4e57);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-option:hover {
    border-color: var(--primary-color, #ff6b35);
    background: var(--background-light, #2a2a2a);
}

.toggle-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color, #ff6b35);
    margin-top: 2px;
}

.toggle-option .toggle-label {
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    font-size: 1.05rem;
    display: block;
    margin-bottom: 4px;
}

.toggle-option .toggle-description {
    font-size: 0.9rem;
    color: var(--text-secondary, #b3b3bd);
    display: block;
}

.toggle-option input[type="checkbox"]:checked ~ .toggle-label {
    color: var(--primary-color, #ff6b35);
}

/* Character Sheet Display */
.character-sheet-display {
    background: var(--background-secondary, #232425);
    border: 2px solid var(--primary-color, #ff6b35);
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.3));
}

.char-header {
    text-align: center;
    border-bottom: 3px solid var(--primary-color, #ff6b35);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.char-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    color: var(--primary-color, #ff6b35);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.char-class {
    font-size: 1.3rem;
    color: var(--accent-blue, #4a9eff);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* Stats Table */
.char-stats {
    margin: 30px 0;
}

.char-stats h3 {
    color: var(--accent-blue, #4a9eff);
    border-bottom: 2px solid var(--border-color, #4e4e57);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px;
    margin: 20px 0;
}

.stats-table th {
    background: var(--background-dark, #1a1a1a);
    color: var(--accent-blue, #4a9eff);
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 8px;
}

.stats-table td {
    background: var(--background-dark, #1a1a1a);
    border: 2px solid var(--border-color, #4e4e57);
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary, #e0e0e0);
}

.stats-table td .modifier {
    display: block;
    font-size: 1rem;
    color: var(--accent-green, #5cb85c);
    margin-top: 5px;
}

/* Skills and Tools Lists */
.char-skills,
.char-tools {
    margin: 30px 0;
}

.char-skills h3,
.char-tools h3 {
    color: var(--accent-blue, #4a9eff);
    border-bottom: 2px solid var(--border-color, #4e4e57);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.skill-list,
.tool-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.skill-list li,
.tool-list li {
    background: var(--background-dark, #1a1a1a);
    border-left: 4px solid var(--primary-color, #ff6b35);
    padding: 12px 15px;
    border-radius: 6px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.skill-list li:hover,
.tool-list li:hover {
    background: var(--background-light, #2a2a2a);
    border-left-width: 6px;
    transform: translateX(5px);
}

/* Story Section */
.char-story {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid var(--primary-color, #ff6b35);
}

.char-story h2 {
    color: var(--primary-color, #ff6b35);
}

.char-story h3 {
    color: var(--accent-blue, #4a9eff);
}

.char-story p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.char-story ul {
    margin-left: 20px;
}

.char-story li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .stat-item {
        flex-wrap: wrap;
        padding: 10px 15px;
    }

    .stat-label {
        flex: 0 0 100%;
        margin-bottom: 10px;
    }

    .stat-value {
        margin: 0;
    }

    .stat-name {
        min-width: auto;
    }

    .stats-table {
        border-spacing: 5px;
    }

    .stats-table th,
    .stats-table td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .char-header h2 {
        font-size: 2rem;
    }

    .char-class {
        font-size: 1.1rem;
    }

    .skill-list,
    .tool-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .character-sheet-display {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .skill-list,
    .tool-list {
        grid-template-columns: 1fr;
    }

    .stat-icon {
        font-size: 1.2rem;
        width: 30px;
    }

    .stat-name {
        font-size: 0.95rem;
    }

    .stat-number {
        font-size: 1.5rem;
        min-width: 40px;
        padding: 6px 10px;
    }

    .stat-modifier {
        font-size: 1.1rem;
    }

    .stat-btn {
        width: 26px;
        height: 26px;
        font-size: 1.1rem;
    }
}

/* Stats Help Button */
.stats-help-btn {
    background: var(--primary-color, #ff6b35);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    font-weight: 600;
}

.stats-help-btn:hover {
    background: var(--primary-dark, #e55a25);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--background-dark, #1a1a1a);
    margin: 3% auto;
    padding: 0;
    border: 2px solid var(--primary-color, #ff6b35);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
}

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

.modal-content h2 {
    background: linear-gradient(135deg, var(--primary-color, #ff6b35), var(--primary-dark, #e55a25));
    color: white;
    margin: 0;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    font-size: 1.8rem;
}

.modal-close {
    color: white;
    float: right;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: -5px;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--background-dark, #1a1a1a);
    text-shadow: 0 0 10px white;
}

.stats-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.stat-description {
    background: var(--background-secondary, #232425);
    border-left: 4px solid var(--primary-color, #ff6b35);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.stat-description h3 {
    color: var(--primary-color, #ff6b35);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.stat-description p {
    color: var(--text-primary, #e0e0e0);
    margin: 0;
    line-height: 1.6;
}

.modifier-explanation {
    background: var(--background-light, #2a2a2a);
    border: 2px solid var(--accent-blue, #4a9eff);
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
}

.modifier-explanation h3 {
    color: var(--accent-blue, #4a9eff);
    margin-top: 0;
    margin-bottom: 15px;
}

.modifier-explanation p {
    color: var(--text-primary, #e0e0e0);
    line-height: 1.6;
}

.modifier-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.modifier-examples div {
    background: var(--background-dark, #1a1a1a);
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-green, #5cb85c);
    border: 1px solid var(--border-color, #4e4e57);
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-content h2 {
        font-size: 1.4rem;
        padding: 15px 20px;
    }

    .stats-modal-body {
        padding: 20px;
    }

    .stat-description h3 {
        font-size: 1.1rem;
    }

    .modifier-examples {
        grid-template-columns: 1fr 1fr;
    }
}
