/* style.css */

/* Reset & Base Styles (Common) */
html {
    scroll-padding-top: 80px; /* For podcast page anchor links */
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    min-height: screen; /* Tailwind equivalent for min-height: 100vh often */
}

/* Elevation / Shadow (Common) */
.elevation-1 {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.elevation-2 {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

/* Card Base Styles (Common & Extended) */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.375rem; /* 6px - consistent rounding */
    overflow: hidden; /* Often needed with rounded corners and borders/backgrounds */
    background-color: #fff; /* Default background */
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), 0 6px 6px rgba(0,0,0,0.15);
}

/* Alerts (Common) */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border-width: 1px;
    border-left-width: 4px;
    display: flex;
    align-items: center;
}
.alert-warning {
    background-color: #fffbeb;
    border-color: #facc15;
    color: #b45309;
}
.alert-info {
    background-color: #eff6ff;
    border-color: #60a5fa;
    color: #1e40af;
}
.alert-error {
    background-color: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}
.alert-icon {
    margin-right: 0.75rem;
    font-size: 1.5rem;
}

/* Scrollbar (Common) - Can be kept if desired */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Animations (Common) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- INDEX.PHP Specific Styles --- */

/* Date Selector */
.date-selector-form {
    background-color: #fff;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.date-selector-form label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0; /* Adjusted */
    flex-shrink: 0; /* Prevent shrinking */
}
.date-selector {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    flex-grow: 1;
    min-width: 150px; /* Ensure it doesn't get too small */
}
.date-selector:focus {
    outline: none;
    border-color: #6366f1; /* Indigo-500 */
    box-shadow: 0 0 0 1px #6366f1;
}
.submit-button { /* Primarily for NoScript */
    padding: 0.5rem 1rem;
    background-color: #4f46e5; /* Indigo-600 */
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.submit-button:hover {
    background-color: #4338ca; /* Indigo-700 */
}

/* Category Tabs */
.category-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin; /* Firefox */
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #e5e7eb; /* Gray-200 */
    background-color: white;
    border-radius: 0.5rem 0.5rem 0 0; /* Rounded top corners */
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 10; /* Ensure it stays above content */
}
.category-tab {
    padding: 0.8rem 1.2rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    color: #4b5563; /* Gray-600 */
}
.category-tab:hover {
    background-color: #f3f4f6; /* Gray-100 */
}
.category-tab.active {
    font-weight: 600;
    /* Color and border-bottom-color are set dynamically via inline style / JS */
}
.category-tab .material-icons,
.category-tab .material-icons-outlined {
    margin-right: 0.4rem;
    font-size: 1.3em;
    vertical-align: bottom; /* Better alignment */
}

/* Category Content */
.category-content {
    display: none;
}
.category-content.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

/* Post Card Specifics (Index) */
.card.index-post-card { /* Added specificity */
   /* border-left-width: 4px; */ /* Moved to inline style in PHP */
   /* border-color: defined dynamically */
   margin-bottom: 1rem; /* Add space between cards */
}

/* Badge (Index) */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 9999px; /* rounded-full */
    /* background-color and color are set dynamically via inline style */
}
.badge .material-icons-outlined {
    font-size: 1.1em; /* Slightly larger icon */
    margin-right: 0.15rem;
    vertical-align: text-bottom; /* Adjust vertical alignment */
}

/* Key Points (Index) */
.key-point-list {
    list-style-type: disc;
    padding-left: 1.5rem; /* Space for the bullet */
    margin-left: 0.5rem; /* Indentation */
    space-y: 0.25rem; /* Space between items */
}
.key-point-list li {
    margin-bottom: 0.4rem; /* Ensure consistent spacing if space-y isn't enough */
    padding-left: 0.25rem; /* Small space after bullet */
}

/* Post Tabs (Index) */
.tab-button { /* Style for Opinii/Comentarii tabs within a post */
    position: relative;
    font-weight: 500;
    overflow: hidden;
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
    flex: 1; /* Make buttons share space */
    padding: 0.5rem; /* py-2 */
    font-size: 0.875rem; /* text-sm */
    text-align: center;
    color: #6b7280; /* text-gray-500 */
}
.tab-button:hover {
    color: #374151; /* text-gray-700 */
}
.tab-button.active {
    color: #2563eb; /* text-blue-600 */
    border-bottom-color: currentColor; /* Use the active text color */
}
.tab-button .material-icons-outlined {
    font-size: 1rem; /* text-base */
    margin-right: 0.25rem; /* mr-1 */
    vertical-align: bottom;
}

/* Post Tab Content (Index) */
.tab-content { /* Content for Opinii/Comentarii */
    display: none;
    min-height: 100px; /* Ensure wrapper has height */
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}
.tab-content-wrapper { /* Parent div for post tabs */
    position: relative;
    /* min-h-[100px] equivalent is handled by .tab-content */
}

/* Opinion Clusters (Index) */
.progress-bar {
    height: 6px;
    background-color: #e9ecef; /* Gray-200 */
    border-radius: 0.25rem; /* rounded-sm */
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    transition: width 0.6s ease;
    /* background-color set via Tailwind classes in PHP */
}
.cluster-comment {
    background-color: #f8f9fa; /* Slightly off-white */
    border-left-width: 3px;
    /* border-color set dynamically via inline style */
    padding: 0.75rem; /* p-3 */
    border-radius: 0.25rem; /* rounded-sm */
    font-style: italic;
    margin-top: 0.5rem; /* mt-2 */
}
.cluster-comment p {
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
}

/* Top Comments (Index) */
.comment-body p {
    margin-bottom: 0.5rem; /* Add space between paragraphs if nl2br creates them */
}
.comment-body {
    margin-top: 0.25rem; /* mt-1 */
    font-size: 0.875rem; /* text-sm */
    color: #374151; /* text-gray-700 */
}


/* --- PODCAST.PHP Specific Styles --- */

/* Sticky Header (Podcast) */
.sticky-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 0.5rem 1rem; /* Adjust padding as needed */
    border-bottom: 1px solid #e5e7eb; /* Gray-200 */
    border-radius: 0.5rem; /* Rounded corners */
    margin-bottom: 1.5rem; /* Space below */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.sticky-header h2 .material-icons-outlined {
     color: #4f46e5; /* text-indigo-600 */
}

/* Platform Icons (Podcast) */
.platform-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 50%; /* Circular */
    transition: color 0.2s ease, background-color 0.2s ease;
    /* color set dynamically */
}
.platform-icon-link:hover {
    background-color: rgba(0,0,0,0.05); /* Slight background on hover */
}
.platform-icon-link .material-icons-outlined {
    font-size: 1.5rem; /* Icon size */
    display: block;
}

/* Main Player Card (Podcast) */
.main-player-card {
    /* border-left-width: 4px; */ /* Moved to inline style */
    /* border-color: defined dynamically */
    overflow: hidden; /* Clip content to rounded corners */
}

/* Audio Player Styling (Podcast) */
.podcast-player audio {
    width: 100%;
    border-radius: 0.375rem;
    margin-top: 1rem; /* Space above player */
}
/* Consider adding more specific audio player styles here if needed */
/* Example: */
/* audio::-webkit-media-controls-panel { background-color: #f3f4f6; } */
/* audio::-webkit-media-controls-play-button { color: #4f46e5; } */

/* Section Header/Content (Podcast) */
.section-header {
    border-radius: 0.5rem 0.5rem 0 0; /* Top rounding */
    padding: 0.8rem 1.2rem;
    /* color: defined dynamically */
    display: flex;
    align-items: center;
    /* background: defined dynamically (gradient) */
}
.section-header .material-icons-outlined {
    margin-right: 0.5rem;
    font-size: 1.5em;
}
.section-content {
    border-radius: 0 0 0.5rem 0.5rem; /* Bottom rounding */
    background-color: #fff;
    padding: 1.25rem;
    border: 1px solid #e5e7eb; /* Gray-200 */
    border-top: none; /* Avoid double border with header */
}

/* Episode List (Podcast) */
.episode-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.5rem; /* Adjust padding */
    border-bottom: 1px solid #e5e7eb; /* Gray-200 */
    transition: background-color 0.2s ease;
    gap: 1rem; /* Space between content and actions */
}
.episode-list-item:last-child {
    border-bottom: none;
}
.episode-list-item.playing {
    background-color: #eff6ff; /* Blue-50 */
}
.episode-list-item:hover {
    background-color: #f3f4f6; /* Gray-100 */
}
.episode-title {
    font-weight: 500; /* medium */
    color: #1f2937; /* Gray-800 */
    margin-bottom: 0.1rem;
    /* Consider line-clamp for long titles if needed */
}
.episode-meta {
    font-size: 0.8rem; /* Smaller text */
    color: #6b7280; /* Gray-500 */
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Wrap if needed on small screens */
    gap: 0.3rem 0.8rem; /* Row and column gap */
    margin-top: 0.25rem; /* mt-1 */
}
.episode-meta > span { /* Target direct children spans */
    display: inline-flex;
    align-items: center;
}
.episode-meta .material-icons-outlined {
    font-size: 1.1em; /* Slightly larger icon */
    margin-right: 0.2rem;
}

/* Episode Actions (Podcast) */
.episode-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between buttons */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}
.play-button, .share-button {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    /* color: defined dynamically */
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 50%;
    line-height: 0; /* Important for centering icon in circle */
}
.play-button:hover, .share-button:hover {
    /* hover color: defined dynamically */
    background-color: rgba(0,0,0,0.05);
}
.play-button .material-icons-outlined {
    font-size: 2rem; /* Larger play icon */
    display: block;
}
.share-button .material-icons-outlined {
    font-size: 1.25rem; /* Standard share icon size */
    display: block;
}

/* About Section (Podcast) */
.about-section img {
    max-width: 180px;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-shrink: 0; /* Prevent image shrinking */
}
.about-section .text-gray-700 { /* Targeting the text div */
   line-height: 1.6; /* Improve readability */
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}