:root {
    --primary-color: #de6d14;
    /* Orange */
    --primary-dark: #4d2e00;
    --secondary-color: #f3f4f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --accent-color: #ef4444;
    --success-color: #10b981;
    --bg-color: #e8d999;
    --card-bg: #ffffff;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: var(--primary-color);
    /* Removed gradient to avoid 'purple' perception and simplify */
    color: white;
    padding: 1rem 0;
    margin-bottom: 0;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Hero Section */
.hero-section {
    background: white;
    padding: 60px 0 100px;
    text-align: center;
    background-image: url('https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
    color: white;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Buttons */
button {
    cursor: pointer;
    background-color: #374151;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button.secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(5px);
}

button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Forms */
input,
textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);

}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.auth-form {
    max-width: 400px;
    margin: 50px auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.dashboard-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid #f3f4f6;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.dashboard-card h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.dashboard-card p {
    color: var(--text-light);
}

/* Custom Program Card Styles */
/* Custom Dashboard Card Styles (Program, Notes, Comments) */
.program-card-custom,
.notes-card-custom,
.comments-card-custom {
    position: relative;
    overflow: hidden;
    color: white;
    z-index: 1;
    border: none;
    /* Enable Container Queries for text sizing */
    container-type: inline-size;
}

/* Background Images */
.program-card-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/dashboard_program_bg_v2.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.notes-card-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/dashboard_notes_bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.comments-card-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/dashboard_comments_bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* Typography styles for all custom cards */
.program-card-custom h3,
.notes-card-custom h3,
.comments-card-custom h3 {
    color: white;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    /* Darker shadow for contrast */

    /* Responsive Text Logic */
    white-space: nowrap;
    /* Prevent line break */
    width: 100%;
    /* Full width */
    text-align: center;
    /* Center text */

    /* Dynamic font size: 7% of container width */
    font-size: clamp(1rem, 7cqw, 2.5rem);
}

.card-subtitle {
    display: none;
    /* Hide subtitle permanently */
}

/* Hover States Removed */

/* Ensure other cards keep their text alignment if affected */

/* Program List */
.conference-meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
    text-align: left;
    /* Keep meta left-aligned */
    width: 100%;
    /* Ensure it takes full width to allow left alignment in centered container */
}

.program-details {
    text-align: center;
    /* Center everything else */
}

.program-details h3 {
    font-size: 1.25rem;
    margin-bottom: 5px;
}

.past-title {
    color: #9ca3af !important;
    /* Tailwind gray-400 */
}

.speaker-name {
    color: var(--text-color);
    font-size: 1rem;
}

.speaker-bio {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 10px;
}

/* Comments */
.comments-list {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.comment-header strong {
    color: var(--text-color);
}

.comment-header span {
    color: var(--text-light);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .program-card {
        flex-direction: column;
    }

    .program-image {
        width: 100%;
        height: auto;
        margin: 5px 0 15px 0 !important;
        /* Force reduced top margin */
    }

    .program-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Ensure program image constraint on desktop too if needed, or specifically target the img tag generally if .program-image class is used */
.program-image img {
    max-height: 115px;
    width: auto;
    object-fit: contain;
}

/* GLOBAL IMAGE FIX: Ensure no image overflows its container */
.program-details img {
    max-width: 100%;
    height: auto;
}

.hidden {
    display: none;
}

/* Notes Card Image Styling */
.note-card {
    position: relative;
    overflow: visible;
    /* Allow image to stick out */
    margin-top: 50px;
    /* Space for the overlapping image */
}

.note-speaker-img {
    position: absolute;
    top: -40px;
    /* Pull image up */
    left: 50%;
    transform: translateX(-50%);
    width: 95px;
    height: 95px;
    border-radius: 50%;
    overflow: hidden;
}

.note-speaker-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    border: 4px solid var(--primary-color);
    position: relative;
    cursor: pointer;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.5rem;
    padding: 5px 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-avatar-large:hover .avatar-overlay {
    opacity: 1;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    /* Default stack, bio changes specific props inline/here */
    justify-content: flex-start;
    /* Start from top, fixes overflow cropping */
}

/* Flush modal variant for full-bleed images */
.modal-content.modal-flush {
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    max-width: 95%;
    max-height: 95%;
}

.modal-content.modal-flush .modal-image {
    max-height: 90vh;
    border-radius: 8px;
    /* Optional: keep a slight rounding on the image itself if desired, or remove */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Slider Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1010;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.nav-btn.prev {
    left: -60px;
}

.nav-btn.next {
    right: -60px;
}

@media (max-width: 768px) {
    .nav-btn {
        padding: 10px 15px;
        font-size: 18px;
    }

    .nav-btn.prev {
        left: 5px;
    }

    .nav-btn.next {
        right: 5px;
    }
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    object-fit: contain;
}

/* Program Container Box */
.program-container-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

@media (max-width: 768px) {
    .hero-section h2 {
        font-size: 1.8rem;
        padding: 0 10px;
    }
}

/* Editor button spacing */
.status-bar button+button {
    margin-top: 10px;
}

/* --- Program Layout Refactor --- */

.program-content {
    display: flex;
    flex-direction: column;
    /* Stack vertical */
    gap: 10px;
    align-items: center;
    /* Center horizontally */
    text-align: center;
    /* Center text */
    margin-top: 10px;
}

.program-image.main-image {
    margin: 0;
    flex-shrink: 0;
    width: auto !important;
    /* Allow natural width or max-width constraint */
    max-width: 100%;
}

/* Internal overrides for Main logic */
.program-image.main-image img {
    max-height: 250px;
    /* Slightly larger for the centered view */
    width: auto;
    border-radius: 8px;
    /* Cosmetic */
}

.program-info {
    flex: 1;
    width: 100%;
    /* Full width to allow centering */
}

.program-title {
    margin-top: 5px;
}

.program-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    /* Center buttons */
    flex-wrap: wrap;
    gap: 10px;
}

.btn-small {
    font-size: 0.9rem;
}

.btn-secondary-action {
    /* gap handles spacing now */
    margin-left: 0;
}

.card-divider {
    margin-top: 20px;
    margin-bottom: 25px;
    border: 0;
    border-top: 1px solid #555;
}


.announcement-image {
    width: 63%;
    /* Reduced from 100% to ensure it's not huge if 500px fails, but max-width below will catch it */
    max-width: 500px !important;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

.program-image.workshop-image {
    margin: 15px 0;
}

.program-image.workshop-image,
.program-image.event-image {
    max-width: 500px !important;
    margin-left: auto;
    margin-right: auto;
    /* Center it */
}

.program-image.workshop-image img,
.program-image.event-image img {
    max-width: 100% !important;
    height: auto !important;
    width: 100%;
}


/* Mobile Adjustments for Program Content */
@media (max-width: 768px) {
    .program-content {
        flex-direction: column;
        align-items: center !important;
        /* Ensure flex items are centered in column */
        text-align: center !important;
        /* Ensure text is centered */
    }

    .program-details {
        text-align: center;
        /* Force centering overrides if any */
    }

    .program-info {
        text-align: center;
    }

    .program-image.main-image {
        width: 100%;
        margin-bottom: 5px;
        text-align: center;
        /* Center the image if it's smaller than width */
    }

    .program-image.main-image img {
        /* Allow image to be larger on mobile if needed, or keep contained */
        max-height: 200px;
    }

    /* Ensure buttons stack with space */
    .program-actions {
        flex-direction: column;
        width: 100%;
    }

    .program-actions button {
        width: 100%;
        margin-bottom: 10px;
        /* Force spacing */
    }
}