/* STRATONOLOGIE® Dictionary - Frontend Styles */

:root {
    --stratono-primary: #1a1a1a;
    --stratono-secondary: #2d2d2d;
    --stratono-accent: #d4af37;
    --stratono-text: #e0e0e0;
    --stratono-text-muted: #a0a0a0;
    --stratono-border: #404040;
    --stratono-hover: #3a3a3a;
}

/* Alphabet Navigation */
.stratono-alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0;
    padding: 20px;
    background: var(--stratono-secondary);
    border-radius: 8px;
    justify-content: center;
}

.stratono-alphabet-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--stratono-primary);
    color: var(--stratono-text);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stratono-alphabet-nav a.active {
    border-color: var(--stratono-accent);
    color: var(--stratono-accent);
}

.stratono-alphabet-nav a.active:hover {
    background: var(--stratono-accent);
    color: var(--stratono-primary);
    transform: scale(1.1);
}

.stratono-alphabet-nav a.inactive {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Glossary Grid Layout */
.stratono-glossary-grid .stratono-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.stratono-term-card {
    background: var(--stratono-secondary);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--stratono-border);
    transition: all 0.3s ease;
    position: relative;
}

.stratono-term-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--stratono-accent);
    border-radius: 8px 0 0 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stratono-term-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
    border-color: var(--stratono-accent);
}

.stratono-term-card:hover::before {
    opacity: 1;
}

.stratono-term-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: var(--stratono-accent);
}

.stratono-term-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.stratono-term-card h3 a:hover {
    color: var(--stratono-text);
}

.stratono-term-card .term-excerpt {
    color: var(--stratono-text-muted);
    line-height: 1.6;
    font-size: 0.95em;
}

/* List Layout */
.stratono-glossary-list .stratono-letter-group {
    margin: 40px 0;
}

.stratono-letter {
    font-size: 2.5em;
    color: var(--stratono-accent);
    margin: 0 0 20px 0;
    padding: 10px 0;
    border-bottom: 3px solid var(--stratono-accent);
    font-weight: 700;
}

.stratono-term-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stratono-term-list li {
    padding: 15px 20px;
    margin: 5px 0;
    background: var(--stratono-secondary);
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.stratono-term-list li:hover {
    border-left-color: var(--stratono-accent);
    background: var(--stratono-hover);
    transform: translateX(5px);
}

.stratono-term-list li a {
    color: var(--stratono-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
}

.stratono-term-list li a:hover {
    text-decoration: underline;
}

.stratono-term-list .term-excerpt {
    color: var(--stratono-text-muted);
    font-size: 0.9em;
}

/* Auto-linked Terms */
a.stratono-term-link {
    color: var(--stratono-accent);
    text-decoration: none;
    border-bottom: 1px dotted var(--stratono-accent);
    padding-bottom: 1px;
    transition: all 0.2s ease;
    position: relative;
}

a.stratono-term-link:hover {
    border-bottom-style: solid;
    color: var(--stratono-text);
}

/* Inline Term Shortcode */
a.stratono-inline-term {
    color: var(--stratono-accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid var(--stratono-accent);
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

a.stratono-inline-term:hover {
    color: var(--stratono-text);
    border-bottom-color: var(--stratono-text);
}

/* Term Card Embed */
.stratono-term-embed {
    background: var(--stratono-secondary);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--stratono-accent);
    margin: 20px 0;
}

.stratono-term-embed h4 {
    margin: 0 0 10px 0;
    color: var(--stratono-accent);
}

.stratono-term-embed h4 a {
    color: inherit;
    text-decoration: none;
}

.stratono-term-embed p {
    margin: 0;
    color: var(--stratono-text-muted);
    line-height: 1.6;
}

/* Tooltip Style */
.stratono-tooltip {
    position: relative;
    cursor: help;
}

.stratono-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--stratono-primary);
    color: var(--stratono-text);
    padding: 10px 15px;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    font-size: 0.85em;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid var(--stratono-accent);
    z-index: 1000;
}

.stratono-tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--stratono-accent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.stratono-tooltip:hover::after,
.stratono-tooltip:hover::before {
    opacity: 1;
}

/* Search Widget */
.stratono-search-widget {
    margin: 30px 0;
}

.stratono-search-input {
    width: 100%;
    padding: 15px 20px;
    background: var(--stratono-secondary);
    border: 2px solid var(--stratono-border);
    border-radius: 8px;
    color: var(--stratono-text);
    font-size: 1em;
    transition: all 0.3s ease;
}

.stratono-search-input:focus {
    outline: none;
    border-color: var(--stratono-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.stratono-search-results {
    margin-top: 15px;
    background: var(--stratono-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--stratono-border);
    display: none;
}

.stratono-search-results.active {
    display: block;
}

.stratono-search-result {
    padding: 15px 20px;
    border-bottom: 1px solid var(--stratono-border);
    transition: background 0.2s ease;
}

.stratono-search-result:last-child {
    border-bottom: none;
}

.stratono-search-result:hover {
    background: var(--stratono-hover);
}

.stratono-search-result a {
    color: var(--stratono-accent);
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.stratono-search-result p {
    color: var(--stratono-text-muted);
    margin: 0;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stratono-glossary-grid .stratono-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stratono-alphabet-nav {
        gap: 5px;
    }
    
    .stratono-alphabet-nav a {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }
    
    .stratono-letter {
        font-size: 2em;
    }
    
    .stratono-term-card {
        padding: 20px;
    }
    
    .stratono-tooltip::after {
        left: 0;
        transform: none;
        max-width: 250px;
    }
}

/* Dark Mode Optimization */
@media (prefers-color-scheme: light) {
    :root {
        --stratono-primary: #ffffff;
        --stratono-secondary: #f5f5f5;
        --stratono-accent: #c49a2e;
        --stratono-text: #1a1a1a;
        --stratono-text-muted: #666666;
        --stratono-border: #e0e0e0;
        --stratono-hover: #ebebeb;
    }
}

/* Print Styles */
@media print {
    .stratono-alphabet-nav {
        display: none;
    }
    
    .stratono-term-card {
        page-break-inside: avoid;
        border: 1px solid #000;
    }
    
    a.stratono-term-link {
        color: #000;
        border-bottom: 1px solid #000;
    }
}