/* Global Styles for Korsordsvaren.se */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #f8f9fa;
    --text-color: #333;
    --answer-color: #e74c3c;
    --border-radius: 8px;
}

body {
    font-family: system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

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

header {
    background: var(--primary-color);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.search-container {
    margin: 2rem auto;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(52,152,219,.2);
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.answer-card {
    background: #fff;
    padding: 2rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: box-shadow .2s;
}

.answer-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.main-answer {
    font-size: 2rem;
    color: var(--answer-color);
    margin: 1rem 0;
    font-weight: 700;
    text-align: center;
}

.breadcrumbs {
    margin: 1rem 0;
    font-size: .9rem;
    color: #666;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color .2s;
}

.breadcrumbs a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Header styles */
.header-link {
    color: white;
    text-decoration: none;
}

/* Footer styles */
.footer-section {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #ddd;
}

.footer-nav-link {
    margin-right: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.footer-nav-link:hover {
    text-decoration: underline;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: .75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: var(--background-color);
    font-weight: 600;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 .75rem;
    }
    
    .search-input {
        font-size: 16px; /* Prevent iOS zoom */
        padding: .8rem;
    }
    
    .main-answer {
        font-size: 1.75rem;
    }
    
    .main-answer-text {
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    .answer-word {
        font-size: 1.8em;
        display: inline-block;
    }
    
    .answer-length {
        font-size: 1rem;
        margin-left: 0.5rem;
        white-space: nowrap;
        display: inline-block;
    }
    
    .answer-card {
        padding: 1.5rem;
        margin: .75rem 0;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        padding: .5rem;
        white-space: nowrap;
    }
}

/* Answer page specific styles */
.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.breadcrumb-item {
    display: inline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
}

.answer-summary {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.main-answer-text {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.answer-word {
    font-size: 2em;
    color: var(--answer-color);
    white-space: nowrap;
}

.answer-length {
    font-size: 1.2rem;
    margin-left: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.alternative-answers {
    background: #f8f9fa;
    border: 2px solid var(--answer-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.alternative-answers h3 {
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
}

.alternative-answers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.alternative-answer-item {
    display: inline-flex;
    align-items: center;
}

.alternative-answer-word {
    color: var(--answer-color);
    font-weight: 600;
    font-size: 1.4rem;
}

.alternative-answer-length {
    margin-left: 0.5rem;
    color: #666;
    font-size: 0.9em;
}

.answer-separator {
    margin: 0 0.5rem;
    color: #ccc;
}

.answer-description {
    margin-top: 0;
    /* Clean, structured content styling */
}

.answer-description h1,
.answer-description h2 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.answer-description h3,
.answer-description h4 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.2rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3rem;
}

.answer-description h1:first-child,
.answer-description h2:first-child,
.answer-description h3:first-child {
    margin-top: 0;
}

.answer-description p {
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: #495057;
    font-size: 16px;
}

.answer-description p:first-of-type {
    font-size: 17px;
    color: #2c3e50;
    font-weight: 500;
}

.answer-description ul {
    padding-left: 1.8rem;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem 1rem 1rem 2.5rem;
    border-left: 4px solid #3498db;
}

.answer-description li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    color: #495057;
    font-size: 16px;
}

.answer-description li::marker {
    color: #3498db;
    font-weight: bold;
}

.answer-description strong {
    color: #2c3e50;
    font-weight: 600;
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
}

.answer-description blockquote {
    border-left: 4px solid #3498db;
    margin: 1.5rem 0;
    padding: 1.2rem;
    font-style: italic;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Consistent H2 styling across all answer-card sections */
.answer-card h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.answer-card h3 {
    color: #2c3e50;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3rem;
}

/* Synonym tags styling */
.synonyms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.synonym-tag {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.synonym-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

/* Usage example styling */
.usage-example {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 1rem;
    border-radius: 0 5px 5px 0;
    font-style: italic;
    color: #495057;
    margin: 0;
}

.related-section {
    margin-bottom: 2rem;
}

.related-section h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.related-clues {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.related-clue-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.related-clue-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.related-item {
    text-decoration: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    color: var(--primary-color);
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.related-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
    text-decoration: none;
}

.related-item-answer {
    color: var(--answer-color);
    font-size: 0.9em;
    margin-top: 0.25rem;
}

.related-clue-link {
    text-decoration: none;
    color: var(--primary-color);
    display: block;
}

.related-clue-text {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.related-clue-length {
    color: #666;
    font-size: 0.9em;
}

.related-item-clue {
    font-weight: 600;
}

/* Content sections for enhanced E-E-A-T */
.content-section {
    background: #fff;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Synonym tags styling */
.synonyms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.synonym-tag {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.synonym-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

/* Voting section */
.vote-section {
    background: #f8f9fa;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid #e9ecef;
}

.vote-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.vote-up:hover {
    background: #27ae60;
}

.vote-down:hover {
    background: #e74c3c;
}

.vote-success {
    color: #27ae60;
    font-weight: 600;
    margin: 0;
}

.vote-error {
    color: #e74c3c;
    font-weight: 600;
    margin: 0;
}

.vote-stats {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-weight: normal;
}

/* Compact alternative answers styling - positioned after main answer */
.alternative-answers-compact {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alternative-answers-compact h4 {
    color: var(--primary-color);
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.3rem;
    display: inline-block;
}

.alternative-answers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.alternative-answers-from-content {
    /* Style the content extracted from article */
    margin-top: 0.5rem;
}

.alternative-answers-from-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alternative-answers-from-content li {
    background: white;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    margin: 0.5rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

.alternative-answers-from-content li:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
    transform: translateY(-1px);
}

.alternative-answers-from-content strong {
    color: var(--answer-color);
    margin-right: 0.5rem;
}

.alternative-answer-compact {
    background: white;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.alternative-answer-compact:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
    transform: translateY(-1px);
}

.alt-answer-word {
    color: var(--answer-color);
    font-weight: 600;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.alt-answer-length {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Mobile responsive for alternative answers */
@media (max-width: 768px) {
    .alternative-answers-compact {
        padding: 0.8rem 1rem;
    }
    
    .alternative-answers-grid {
        gap: 0.6rem;
    }
    
    .alternative-answer-compact {
        padding: 0.4rem 0.6rem;
    }
    
    .alt-answer-word {
        font-size: 0.9rem;
    }
    
    .alt-answer-length {
        font-size: 0.8rem;
    }
}