:root {
    --primary-color: #7b2cbf;
    --primary-light: #9d4edd;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --text-color: #2b2d42;
    --light-text: #6c757d;
    --background: #ffffff;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --success: #4caf50;
    --shadow: rgba(0, 0, 0, 0.1);
    
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-secondary: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    --border-radius: 8px;
}

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

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

h1 {
    font-family: var(--font-secondary);
    font-size: 2rem;
    color: var(--primary-color);
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

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

.btn.small {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.btn.primary:hover {
    background-color: var(--primary-light);
}

.btn.secondary:hover {
    background-color: rgba(123, 44, 191, 0.1);
}

.character-basics {
    background-color: var(--background);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px var(--shadow);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--light-text);
    font-size: 0.85rem;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(123, 44, 191, 0.2);
}

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

.char-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.left-column,
.middle-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

section {
    background-color: var(--background);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px var(--shadow);
}

/* Abilities Section */
.abilities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.ability {
    position: relative;
    text-align: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--light-bg);
    transition: transform 0.3s ease;
}

.ability:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px var(--shadow);
}

.ability label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.ability input {
    width: 60px;
    text-align: center;
    margin: 0 auto;
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
}

.ability-mod {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: 600;
    margin-top: 5px;
}

/* Combat Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    margin-bottom: 10px;
}

.stat-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 5px;
}

/* Skills Section */
.skill-list {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 5px;
}

.skill {
    display: flex;
    align-items: center;
    padding: 3px 0;
}

.skill input[type="checkbox"] {
    margin-right: 8px;
}

.skill-mod {
    display: inline-block;
    width: 30px;
    text-align: center;
    margin-right: 8px;
    font-weight: 600;
}

/* Saving Throws */
.saving-throws-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.save {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.save input[type="checkbox"] {
    margin-right: 8px;
}

.save-mod {
    display: inline-block;
    width: 30px;
    text-align: center;
    margin-right: 8px;
    font-weight: 600;
}

/* Attacks Section */
.attacks-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.attacks-table th,
.attacks-table td {
    padding: 8px;
    text-align: left;
}

.attacks-table th {
    background-color: var(--light-bg);
    font-weight: 600;
}

.attacks-table input {
    width: 100%;
}

/* Equipment Section */
.currency {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    background-color: var(--light-bg);
    padding: 10px;
    border-radius: var(--border-radius);
}

.currency-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.currency-item label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.currency-item input {
    width: 60px;
    text-align: center;
}

/* Character Details */
.detail-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Spellcasting */
.spellcasting-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.spell-levels {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spell-level h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slots {
    font-size: 0.85rem;
    font-weight: normal;
}

.slot-input {
    width: 40px;
    text-align: center;
    display: inline-block;
    padding: 3px 6px;
}

.spell-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.spell-item {
    display: flex;
    align-items: center;
    background-color: var(--light-bg);
    padding: 5px 10px;
    border-radius: var(--border-radius);
}

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

.add-spell {
    align-self: flex-start;
    margin-top: 5px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--light-text);
    font-size: 0.8rem;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: var(--success);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .char-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .right-column {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .char-content {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        grid-column: auto;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .detail-columns {
        grid-template-columns: 1fr;
    }
    
    .actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    section, .character-basics {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .actions, #add-attack, .add-spell {
        display: none;
    }
    
    footer {
        margin-top: 20px;
    }
}
