/* === USER FLOW PAGES (Login, Register, Profile) === */

/* Specific override for profile page to keep it black but match font/weight */
.profile-header-container h1.hero-title {
    /* Revert to default hero-title styles (white with shadow) */
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    font-size: clamp(1.5rem, 4vw, 2rem) !important; /* Cap size for profile to make it smaller */
}

/* Profile Card Styling (Matches Gostilna Card) */
.profile-card {
    background: #ffffff;
    border-radius: var(--card-radius); /* 24px */
    padding: 0; /* Handled by drill layout */
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
    border: 1px solid var(--section-color);
    height: 525px !important; /* Fixed height matching restaurant-card */
    overflow: hidden;
    max-width: 600px !important;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .profile-card {
        height: 525px !important; /* Keep fixed height on mobile too */
        border-radius: var(--card-radius) !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    
    .hide-mobile {
        display: none;
    }
    
    #msg-toolbar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    #msg-toolbar > div {
        width: 100%;
        justify-content: space-between;
    }
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh; /* Keep it centered vertically */
}

.auth-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--section-color);
    text-align: center;
    margin: 0 auto;
}

.auth-card h2 {
    margin-bottom: 30px;
    color: #000000;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--section-color);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    font-family: var(--font-main);
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.auth-links {
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}

.error-msg {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}


.profile-tab-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: 0px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
    white-space: nowrap; /* Added from profile.php */
}

.tab-btn.active,
.profile-tab-btn.active {
    background: #A8BFA8; /* Matches style.css .tab-btn.active (was var(--primary-color) in profile.php) */
    color: #fff;
    border-color: #333;
}

/* --- Profile Page Redesign (Swiper Card System) --- */

/* Breadcrumb Bar */
.profile-breadcrumb-bar {
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
    background: #fff;
    min-height: 50px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Horizontal Scrolling Container (Snap) */
.horizontal-scroll-snap {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.horizontal-scroll-snap::-webkit-scrollbar {
    display: none;
}
.horizontal-scroll-snap > * {
    flex: 0 0 auto;
    width: 280px; /* Default Card Width */
    scroll-snap-align: start;
}

/* --- Profile Redesign v3: Gallery Overlay --- */

/* The Full Screen Overlay */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Blurred Backdrop */
.detail-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Card Wrapper (Centers the Swiper) */
.detail-card-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 80vh;
    z-index: 2001;
    display: flex;
    flex-direction: column;
}

/* Close Button (Floating) */
.btn-close-overlay {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s;
}
.btn-close-overlay:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Swiper Container inside Overlay */
.detailSwiper {
    width: 100%;
    height: 100%;
}

.detail-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Padding for mobile edges */
}

/* The Actual Content Card */
.detail-content-card {
    background: #ffffff;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

/* Mobile Tweaks for Overlay */
@media (max-width: 768px) {
    .detail-card-wrapper {
        height: 85vh; /* Taller on mobile */
        max-width: 90%;
    }
    
    .btn-close-overlay {
        top: 10px;
        right: 10px;
        z-index: 2005;
        background: #f0f0f0;
        color: #333;
    }
    
    .detail-content-card {
        padding: 20px;
    }
}

/* Detail Typography */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.detail-date {
    font-size: 13px;
    color: #888;
}

.detail-body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

/* Swiper Pagination Customization */
.detailSwiper .swiper-pagination-bullet {
    background: rgba(255,255,255,0.5);
    opacity: 1;
}
.detailSwiper .swiper-pagination-bullet-active {
    background: #fff;
}

.msg-card-new {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}
.msg-card-new:active {
    transform: scale(0.98);
}
.msg-card-new.unread {
    border-left: 4px solid var(--primary-color);
    background: #fffafa;
}
.msg-card-new .msg-icon {
    font-size: 24px;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
}
.msg-card-new .msg-info {
    flex: 1;
    min-width: 0; /* Text truncation fix */
}
.msg-card-new .msg-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-card-new .msg-date {
    font-size: 12px;
    color: #999;
}

/* Detail View Components */
.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}
.btn-back {
    background: #f5f5f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    font-size: 16px;
}
.detail-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}
.detail-body {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}
@media (max-width: 768px) {
    .mobile-top-spacer {
        margin-top: 5px !important;
        padding-top: 5px !important;
    }
}

/* Card 5 Height Fix (Matches .restaurant-card 525px on ALL devices) */
.story-card-slide {
    height: 525px !important;
}

/* Ensure image scales properly within fixed height */
.story-card-slide .story-img {
    height: 200px !important; /* Keep image height consistent */
    flex-shrink: 0;
}

/* Ensure body takes remaining space */
.story-card-slide .story-body {
    flex: 1;
    overflow-y: auto; /* Allow scrolling if content is too long */
}

/* --- DRILL-DOWN MENU SYSTEM (v4) --- */
.drill-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 60px;
}

.drill-back-btn {
    background-color: #eeeeee;
    color: #000000;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
    transition: background 0.2s;
}

.drill-back-btn:hover {
    background-color: #e0e0e0;
}

.drill-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: max-content;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drill-viewport {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    flex: 1; /* Take remaining height */
    background: #fff;
    /* Removed min-height: 600px to allow flex to work */
}

.drill-level {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 20px;
    overflow-y: auto;
    display: none; /* Hide by default */
}

.drill-level.active {
    display: block;
    transform: translateX(0);
    z-index: 5;
}

.drill-level.next {
    display: block;
    transform: translateX(100%);
    z-index: 6;
}

.drill-level.prev {
    display: block;
    transform: translateX(-30%); /* Parallax effect for previous level */
    z-index: 1;
    opacity: 0.5; /* Fade out slightly */
}

/* Level 1 Menu Grid */
.drill-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drill-menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.drill-menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.drill-icon {
    width: 40px;
    height: 40px;
    background: #f6f7f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000000;
    margin-right: 15px;
}

.drill-label {
    flex: 1;
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.drill-arrow {
    color: #ccc;
    font-size: 14px;
}

/* Tab Navigation inside Drill Level 2 */
.drill-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.drill-tab-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.drill-tab-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* Vertical List Items (Profile - Loved Gostilne) */
.profile-loved-gostilne-container {
    display: flex;
    flex-direction: column;
    gap: 0; /* No gap, handled by border-bottom */
    width: 100%;
}

.loved-gostilna-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f9f9f9;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    width: 100%;
}

.loved-gostilna-item:hover {
    background-color: #fcfcfc;
}

.loved-gostilna-item:last-child {
    border-bottom: none;
}

.loved-gostilna-img-small {
    width: 40px;
    height: 40px;
    border-radius: 8px; /* Slightly rounded square */
    object-fit: cover;
    background-color: #f6f7f6;
    margin-right: 15px;
    flex-shrink: 0;
}

.loved-gostilna-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Text truncation fix */
}

.loved-gostilna-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 2px 0;
    /* Allow multi-line */
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.loved-gostilna-city {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

.loved-gostilna-arrow {
    color: #ddd;
    font-size: 12px;
    margin-left: 10px;
}
.drill-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
}
.drill-list-item:hover {
    background: #fcfcfc;
}

/* Search Result Item Styles */
.search-result-link {
    text-decoration: none !important;
    color: inherit !important;
}

.search-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.search-result-name {
    margin-bottom: 0 !important;
}

.search-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.search-result-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

#location-toggle {
    display: none;
}

#results-display {
    margin-top: 20px;
}

/* Like Count */
.like-count-span {
    margin-left: 5px;
    font-weight: 600;
}

/* Custom Story Card Styles */
.story-card-custom {
    height: 100% !important;
    border: none !important;
    box-shadow: none !important;
}

.story-link-block {
    display: block;
}

.story-img-custom {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.story-body-custom {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.story-header-custom {
    text-align: center;
}

.story-text-container-custom {
    flex: 1;
    margin-top: 15px;
}

.story-footer-custom {
    margin-top: auto;
    padding-top: 15px;
    text-align: center;
}

/* Load More Container */
.load-more-container {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 20px;
}

/* Modal Styles from seznam_zgodb.php */
.story-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98); /* Light overlay or white */
    z-index: 9999;
    overflow-y: auto;
    padding: 20px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}
.story-modal-overlay.open {
    opacity: 1;
    display: block !important;
}
.story-modal-content {
    max-width: 800px; /* Match article width */
    margin: 0 auto;
    position: relative;
    min-height: 100%;
}
/* Close button style matching the one in ajax response */
.close-story-btn {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #f1f1f1;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.close-story-btn:hover {
    background: #e1e1e1;
}
/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Card Zgodba Styles */
.story-card-link-block {
    text-decoration: none !important;
    display: block;
}

.story-header-centered {
    align-items: center;
    text-align: center;
}

.story-title-link {
    text-decoration: none !important;
}

/* Empty State Korenine */
.empty-state-korenine {
    grid-column: 1/-1;
    text-align: center;
    padding: 100px;
    color: #555;
    font-family: 'Merriweather', serif;
}

/* --- Profile Page Updates --- */
.profile-card h2 { color: #000; }
.profile-header-container { text-align: center; margin-bottom: 30px; }

/* Override profile-card default fixed height for report view */
.profile-card.report-view {
    padding: 20px;
    height: auto !important;
    overflow: visible !important;
}

/* Drill Down Specifics */
.drill-badge-notification {
    background: #ef4444; 
    color: white; 
    font-size: 11px; 
    padding: 2px 6px; 
    border-radius: 10px; 
    margin-right: 10px;
}

.drill-icon.danger { color: #d32f2f; }
.drill-label.danger { color: #d32f2f; }

.trash-btn-container { text-align: right; margin-bottom: 10px; }
.btn-trash-empty {
    color: #d32f2f; 
    background: none; 
    border: 1px solid #d32f2f; 
    border-radius: 4px; 
    padding: 5px 10px; 
    font-size: 12px; 
    cursor: pointer;
}


/* Drill List Item Styles */
.drill-item-subject { font-weight: 600; color: #333; }
.drill-item-subject.deleted { color: #666; text-decoration: line-through; }
.drill-item-date { font-size: 12px; color: #888; }
.drill-item-dot { width: 8px; height: 8px; background: var(--primary-color); border-radius: 50%; margin-right: 10px; }

/* Settings */
.settings-input-readonly { background-color: #f5f5f5; color: #888; cursor: not-allowed; }

