/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0A0A0A;
    background: #FFFFFF;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;  /* Větší padding zleva a zprava */
}

/* Header - clean design */
.header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 24px 0;
    border-bottom: 1px solid #E5E5E5;
    margin-bottom: 32px;
}

.logo {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #0A0A0A;
    text-decoration: none;
    transition: color 0.2s;
}

.logo:hover {
    color: #0891B2;
}

/* Filters */
.filters {
    margin-bottom: 40px;
    padding: 24px 0;
    border-bottom: 1px solid #E5E5E5;
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid #E5E5E5;
    background: white;
    font-size: 14px;
    color: #0A0A0A;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 150px;
}

.filter-select:hover {
    border-color: #0891B2;
}

.filter-select:focus {
    outline: none;
    border-color: #0891B2;
}

/* Language filter - initially hidden */
#languageFilter {
    display: none;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #E5E5E5;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #0891B2;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0891B2;
}

.filter-checkbox:hover {
    color: #0891B2;
}

/* Study item improvements */
.study-item {
    border-top: 1px solid #E5E5E5;
    margin-bottom: 2px;
    position: relative;
}

.study-header {
    padding: 36px 60px 36px 20px;  /* Přidán padding zleva */
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.study-header:hover {
    background: linear-gradient(90deg, rgba(8,145,178,0.02) 0%, transparent 100%);
}

.study-header.active {
    background: linear-gradient(90deg, rgba(8,145,178,0.03) 0%, transparent 100%);
}

.study-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #0A0A0A;
    margin-bottom: 10px;
    line-height: 1.3;
    padding-right: 20px;
    transition: color 0.2s;
}

.study-header:hover .study-title {
    color: #0891B2;
}

/* Study meta - improved link visibility */
.study-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.study-meta a {
    color: #0891B2;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    padding: 2px 6px;
    border-radius: 3px;
}

.study-meta a:hover {
    background: #E8F5F7;
    color: #0E7490;
}

/* Author links - styled as mini buttons */
.study-meta a[title="LinkedIn"],
.study-meta a[title="Web"] {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    padding: 2px 8px;
    margin-left: 4px;
    font-size: 12px;
    color: #6B7280;
}

.study-meta a[title="LinkedIn"]:hover {
    background: #0077B5;
    color: white;
    border-color: #0077B5;
}

.study-meta a[title="Web"]:hover {
    background: #4B5563;
    color: white;
    border-color: #4B5563;
}

.study-meta .separator {
    color: #CCC;
    margin: 0 8px;
}

/* Updated date styling */
.study-meta .updated {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-left: 4px;
}

.study-summary {
    color: #333;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
    padding-right: 20px;
}

/* Categories badges - clean, non-clickable */
.study-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.category-badge {
    padding: 4px 10px;
    background: #F3F4F6;
    color: #4B5563;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    border: 1px solid #E5E7EB;
    cursor: default;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Language indicator */
.language-indicator {
    display: inline-flex;
    padding: 2px 6px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    border-radius: 2px;
    text-transform: uppercase;
}

/* Expand/Collapse Button */
.expand-toggle {
    position: absolute;
    right: 20px;  /* Odsazení od pravého okraje */
    top: 36px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 3px;  /* Méně zaoblené */
    cursor: pointer;
    transition: all 0.2s;
}

.expand-toggle:hover {
    border-color: #0891B2;
    background: #F8FAFB;
}

.expand-toggle.active {
    border-color: #0891B2;
    background: #0891B2;
    color: white;
}

.expand-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.expand-toggle.active svg {
    transform: rotate(180deg);
}

/* Study Content */
.study-content {
    padding: 0 80px 40px 20px;  /* Více paddingu zprava kvůli tlačítku */
    display: none;
}

.study-content.open {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Article headline - new */
.article-headline {
    font-size: 18px;
    font-weight: 600;
    color: #0891B2;
    margin-bottom: 16px;
    line-height: 1.4;
    padding-bottom: 12px;
    border-bottom: 2px solid #E8F5F7;
}

.article-text {
    font-size: 16px;
    line-height: 1.8;
    color: #222;
    margin-bottom: 32px;
}

.article-text p {
    margin-bottom: 20px;
}

.article-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px 0;
    color: #0A0A0A;
}

.article-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: #0A0A0A;
}

/* Audio Player */
.audio-section {
    background: #F8F8F8;
    padding: 20px;
    margin: 24px 0;
    border-left: 3px solid #0891B2;
}

.audio-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 12px;
}

.study-audio {
    width: 100%;
    height: 40px;
}

.audio-duration {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Action Buttons - clean design */
.study-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E5E5E5;
}

.btn-primary {
    padding: 10px 20px;
    background: #0891B2;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #06B6D4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
}

.btn-secondary {
    padding: 10px 20px;
    background: white;
    color: #0891B2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #0891B2;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #F0F9FF;
    border-color: #06B6D4;
    color: #06B6D4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.1);
}

/* Footer */
.footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid #E5E5E5;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.footer a {
    color: #0891B2;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Loading and No Results */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Tags - clickable, clean design */
.study-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tag {
    padding: 4px 10px;
    background: #FFFFFF;
    color: #666;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 3px;
    border: 1px solid #E5E5E5;
    cursor: pointer;
}

.tag:hover {
    background: #0891B2;
    color: white;
    border-color: #0891B2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.15);
}

/* Audio indicator */
.audio-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #E8F5F7;
    color: #0891B2;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    border-radius: 2px;
}

/* SEO and Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0891B2;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Print styles */
@media print {
    .filters,
    .study-actions,
    .expand-toggle,
    .audio-section {
        display: none !important;
    }
    
    .study-content {
        display: block !important;
    }
    
    .study-header {
        cursor: default;
        background: none !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
    }
    
    .filter-row {
        flex-wrap: wrap;
    }
    
    .search-input {
        width: 100%;
        order: -1;
    }
    
    .filter-select {
        flex: 1;
        min-width: calc(50% - 8px);
    }
    
    #languageFilter {
        min-width: 100%;
    }
    
    .filter-checkbox {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .study-header {
        padding: 30px 50px 30px 16px;
    }
    
    .study-title {
        font-size: 20px;
    }
    
    .study-meta {
        font-size: 13px;
        gap: 2px;
    }
    
    .study-meta .separator {
        margin: 0 4px;
    }
    
    .expand-toggle {
        width: 36px;
        height: 36px;
        top: 30px;
        right: 10px;  /* Odsazení od kraje */
    }
    
    .study-content {
        padding: 0 16px 40px 16px;
    }
    
    .article-headline {
        font-size: 16px;
    }
    
    .study-categories {
        gap: 6px;
    }
    
    .category-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .study-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Tablet specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 20px 30px;
    }
    
    .filter-select {
        min-width: 120px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .category-badge {
        border: 1px solid currentColor;
    }
    
    .tag {
        border: 1px solid currentColor;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
