/* ===================================
   RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: #e0e0e0;
    padding: 2rem;
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================================
   CONTAINER & LAYOUT
   =================================== */
.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ===================================
   HEADER
   =================================== */
h1 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #ffd700;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.7),
        0 0 20px rgba(255, 215, 0, 0.3);
    letter-spacing: 1px;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

/* ===================================
   CHARACTER ENTRY
   =================================== */
.character-entry {
    margin-bottom: 1.5rem;
    background: linear-gradient(145deg, #2a2a2a 0%, #252525 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.4),
        0 1px 3px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 215, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.character-entry:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
}

/* ===================================
   FIRST NAME HEADER
   =================================== */
.first-name-header {
    padding: 1.2rem 1.8rem;
    background: linear-gradient(135deg, #3a3a3a 0%, #333333 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    user-select: none;
    border-bottom: 1px solid rgba(0,0,0,0.3);
}

.first-name-header:hover {
    background: linear-gradient(135deg, #404040 0%, #383838 100%);
    padding-left: 2rem;
}

.first-name-title {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex: 1;
    flex-wrap: wrap;
}

.first-name-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

.earth-tag {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    font-weight: 400;
    padding: 0.2rem 0.6rem;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.middle-name-tag {
    font-size: 1rem;
    color: #88ccff;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    background: rgba(136, 204, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(136, 204, 255, 0.3);
}

.toggle-icon {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.toggle-icon.open {
    transform: rotate(90deg);
}

/* ===================================
   FIRST NAME CONTENT
   =================================== */
.first-name-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.first-name-content.open {
    max-height: 5000px;
}

.first-name-meanings {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #252525 0%, #222222 100%);
}

.meaning-item {
    padding: 0.5rem 0;
    color: #c8c8c8;
    font-size: 1.05rem;
    line-height: 1.7;
    position: relative;
    padding-left: 1.2rem;
}

.meaning-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #ffd700;
    font-weight: bold;
}

/* ===================================
   LAST NAMES LIST
   =================================== */
.last-names-list {
    padding: 0.8rem 0 1rem 0;
}

.last-name-entry {
    margin: 0.8rem 1.8rem;
    background: linear-gradient(145deg, #2d2d2d 0%, #282828 100%);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(153, 204, 255, 0.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ===================================
   LAST NAME HEADER
   =================================== */
.last-name-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #333 0%, #2d2d2d 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    user-select: none;
}

.last-name-header:hover {
    background: linear-gradient(135deg, #383838 0%, #323232 100%);
    padding-left: 1.7rem;
}

.last-name-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #99ccff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    letter-spacing: 0.3px;
}

/* ===================================
   LAST NAME CONTENT
   =================================== */
.last-name-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.last-name-content.open {
    max-height: 3000px;
}

.last-name-meanings {
    padding: 1.3rem 1.5rem;
    background: linear-gradient(135deg, #282828 0%, #242424 100%);
}

/* ===================================
   FULL NAME MEANING
   =================================== */
.full-name-meaning {
    margin-top: 1.3rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%);
    border-left: 4px solid #ffd700;
    border-radius: 6px;
    box-shadow: 
        inset 0 1px 3px rgba(0,0,0,0.3),
        0 2px 4px rgba(0,0,0,0.2);
}

.full-name-meaning-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffd700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.full-name-meaning-text {
    color: #d8d8d8;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ===================================
   NOTES
   =================================== */
.notes {
    margin-top: 1.3rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #151515 100%);
    border-left: 4px solid #ff9966;
    border-radius: 6px;
    font-style: italic;
    color: #b8b8b8;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: 
        inset 0 1px 3px rgba(0,0,0,0.3),
        0 2px 4px rgba(0,0,0,0.2);
}

.notes::before {
    content: "Note: ";
    font-weight: 600;
    color: #ff9966;
    font-style: normal;
}

/* ===================================
   EMPHASIS STYLES
   =================================== */
em, i {
    font-style: italic;
    color: #b8d4ff;
    text-shadow: 0 0 8px rgba(184, 212, 255, 0.3);
}

strong, b {
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

u {
    text-decoration: underline;
    text-decoration-color: #99ccff;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

mark {
    background: linear-gradient(135deg, #4a4a2a 0%, #3d3d22 100%);
    color: #ffffaa;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

code {
    font-family: 'Courier New', 'Consolas', monospace;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: #ff99cc;
    font-size: 0.95em;
    border: 1px solid rgba(255, 153, 204, 0.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

sup {
    font-size: 0.75em;
    vertical-align: super;
}

sub {
    font-size: 0.75em;
    vertical-align: sub;
}

/* ===================================
   LOADING & ERROR STATES
   =================================== */
.loading {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.error {
    background: linear-gradient(135deg, #4a2020 0%, #3a1515 100%);
    border: 2px solid #803030;
    padding: 1.5rem;
    border-radius: 8px;
    color: #ffaaaa;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(128, 48, 48, 0.4);
    font-size: 1.05rem;
}

/* ===================================
   SCROLLBAR STYLING
   =================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 10px;
    border: 2px solid #1a1a1a;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .first-name-header {
        padding: 1rem 1.2rem;
    }
    
    .first-name-text {
        font-size: 1.3rem;
    }
    
    .first-name-meanings {
        padding: 1rem 1.2rem;
    }
    
    .last-name-entry {
        margin: 0.8rem 1rem;
    }
    
    .meaning-item {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }
    
    .first-name-text {
        font-size: 1.2rem;
    }
    
    .first-name-title {
        gap: 0.6rem;
    }
    
    .earth-tag,
    .middle-name-tag {
        font-size: 0.8rem;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .character-entry,
    .last-name-entry {
        page-break-inside: avoid;
    }
    
    .toggle-icon {
        display: none;
    }
    
    .first-name-content,
    .last-name-content {
        max-height: none !important;
    }
}
