/* Reset and base variables */
:root {
    --bg-color: #ffffff;
    --nav-bg: #000000;
    --text-light: #ffffff;
    --text-dark: #1a1a1a;
    --header-height: 60px; /* Fixed header height in pixels */
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
}

/* --- Global Custom Scrollbar (Premium Phostory Style) --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
    border: 3px solid #ffffff; /* Gives it some breathing room from the edge */
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* For Firefox: CSS standard scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

/* Navigation Bar (Top black toolbar) */
.top-nav {
    background-color: var(--nav-bg);
    height: var(--header-height);
    padding: 0 20px; /* Horizontal padding in pixels */
    display: flex;
    justify-content: space-between; /* Space out child elements */
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Hamburger menu icon */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px; /* Explicit vertical spacing to prevent clipping */
    width: 30px;
    padding: 2px 0; /* Small internal padding to protect the last bar line */
    cursor: pointer;
    z-index: 1001; /* Above logo and dropdown */
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--text-light);
    border-radius: 0;
    flex-shrink: 0;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Optimized transition */
}

/* X-shape animation on toggle active */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Elegant white text logo */
.logo {
    color: var(--text-light);
    font-size: 24px; /* Fine-tuned pixel size */
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    position: absolute; /* Absolute centering within top-nav */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Spacer to maintain visual balance for centered logo */
.nav-placeholder {
    width: 30px; 
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%; /* Sticks to bottom of top-nav */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Semi-transparent black rendering */
    backdrop-filter: blur(8px);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-bottom 0.4s ease;
    border-bottom: 0px solid rgba(255, 255, 255, 0);
}

.dropdown-menu.active {
    max-height: 500px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: padding 0.4s ease;
}

.dropdown-menu.active ul {
    padding: 1.5rem 0;
}

.dropdown-menu li {
    width: 100%;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-menu.active li {
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu.active li:nth-child(1) { transition-delay: 0.1s; }
.dropdown-menu.active li:nth-child(2) { transition-delay: 0.15s; }
.dropdown-menu.active li:nth-child(3) { transition-delay: 0.2s; }
.dropdown-menu.active li:nth-child(4) { transition-delay: 0.25s; }
.dropdown-menu.active li:nth-child(5) { transition-delay: 0.3s; }

.dropdown-menu a {
    display: block;
    padding: 1rem 3rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 1px;
    text-align: center;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.dropdown-menu a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Content Area (Main white background section) */
.content-area {
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    background-color: var(--bg-color);
    padding: 40px 20px; /* Mobile-first padding */
}

@media (min-width: 768px) {
    .content-area {
        padding: 60px 10%; /* 오리지널 여백 복구 */
    }
}

/* --- Home Page (Main) Styles --- */
.home-header {
    text-align: center;
    margin-bottom: 40px;
}

.home-title {
    font-size: 32px; /* Mobile optimized size */
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

@media (min-width: 768px) {
    .home-title {
        font-size: 48px;
    }
}

.home-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
    font-weight: 300;
}

.filter-chips {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.chip {
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chip:hover {
    background-color: #e5e7eb;
}

.chip.active {
    background-color: var(--text-dark);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Masonry Grid CSS (Modern column-count approach) */
/* New JS-based Masonry System (Fixes gaps and alignment) */
.masonry-root {
    display: flex;
    gap: 1.5rem; /* 가로 간격 */
    width: 100%;
    align-items: flex-start;
}

.masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 세로 간격 - 가로와 완벽히 일치시킴 */
}

@media (max-width: 600px) {
    .masonry-root {
        gap: 0.75rem; /* 모바일 가로 간격 */
    }
    .masonry-column {
        gap: 0.75rem; /* 모바일 세로 간격 */
    }
}

.photo-card {
    width: 100%;
    margin: 0 !important; /* 원치 않는 추가 여백 방지 */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #ffffff;
    transform: translateZ(0);
}

/* Individual Photo Card */
.photo-card {
    display: inline-block; /* column-count 상단 정렬 버그 방지 */
    vertical-align: top;   /* 두 줄의 시작점을 일직선으로 맞춤 */
    width: 100%;
    break-inside: avoid;
    margin-top: 0;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #ffffff;
    transform: translateZ(0);
}


.card-image-wrapper {
    width: 100%;
    display: block;   
}

.card-image-wrapper img {
    width: 100%;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-card:hover .card-image-wrapper img {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}

/* Premium glassmorphism overlay */
.glass-overlay {
    position: absolute;
    inset: 0; 
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

@media (max-width: 500px) {
    .glass-overlay {
        padding: 0.8rem; /* 모바일에서 패딩 축소 */
    }
}

.photo-card:hover .glass-overlay,
.photo-card.touch-active .glass-overlay {
    opacity: 1;
}

.overlay-content {
    transform: translateY(15px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-card:hover .overlay-content,
.photo-card.touch-active .overlay-content {
    transform: translateY(0);
}


.photo-title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 500px) {
    .photo-title {
        font-size: 0.9rem; /* 모바일에서 제목 크기 축소 */
        margin-bottom: 0.4rem;
    }
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photographer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f3f4f6;
    font-size: 0.9rem;
    font-weight: 300;
    overflow: hidden;
}

.photographer span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 500px) {
    .photographer {
        font-size: 0.75rem; /* 모바일에서 작성자 텍스트 축소 */
        gap: 5px;
    }
}

.photographer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .photographer-avatar {
        width: 20px; /* 모바일에서 아바타 축소 */
        height: 20px;
    }
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .btn-icon {
        width: 30px; /* 모바일에서 하트 버튼 축소 */
        height: 30px;
    }
    .btn-icon svg {
        width: 14px;
        height: 14px;
    }
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* --- About Us Page Styles --- */
.about-page-bg {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.about-container {
    max-width: 800px;
    width: 100%;
    padding: 30px 20px;
}

@media (min-width: 768px) {
    .about-container {
        padding: 60px 40px;
        margin-top: 20px;
        margin-bottom: 40px;
    }
}

.about-header {
    text-align: center;
    margin-bottom: 3rem;
}

.about-header h2 {
    font-size: 3rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.about-header .subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    font-weight: 300;
}

.about-content p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 1.5rem;
    font-weight: 300;
    text-align: center;
}

.about-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.about-features {
    display: flex;
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    flex: 1;
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #f3f4f6;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0;
}

/* Responsive (Mobile view) */
@media (max-width: 768px) {
    .about-features {
        flex-direction: column;
    }
    
    .about-container {
        padding: 3rem 1.5rem;
    }
    
    .about-header h2 {
        font-size: 2.2rem;
    }
}

/* --- Make My Phostory (Build Page) Styles --- */
.build-page-bg {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.make-container {
    max-width: 700px;
    width: 100%;
    padding: 30px 20px;
}

@media (min-width: 768px) {
    .make-container {
        padding: 40px 60px;
        margin-top: 20px;
        margin-bottom: 40px;
    }
}

.make-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.make-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.make-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Upload Area (Glass & Dashed Style) */
.upload-area {
    position: relative;
    width: 100%;
    min-height: 250px; /* 사진이 없을 때의 최소 높이 */
    border: 2px dashed #d1d5db;
    border-radius: 20px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--text-dark);
    background-color: #f1f5f9;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6b7280;
    pointer-events: none;
}

.upload-icon {
    margin-bottom: 1rem;
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px);
}

.upload-placeholder span {
    font-weight: 600;
    font-size: 1.1rem;
}

.upload-hint {
    font-size: 0.85rem !important;
    font-weight: 300 !important;
    color: #9ca3af;
    margin-top: 0.5rem;
}

#photoPreview {
    width: 100%;
    height: auto; /* 비율에 맞춰 자동 조절 */
    display: block;
    object-fit: contain; /* 사진 전체를 다 보여줌 */
    z-index: 5;
    position: relative; /* absolute 해제하여 부모 높이에 영향 줌 */
    transition: transform 0.3s ease;
}

.upload-area:hover #photoPreview {
    transform: scale(1.01);
}

/* Modern Input Fields */
.input-modern label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.input-modern input, .input-modern textarea {
    width: 100%;
    padding: 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.input-modern input:focus, .input-modern textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

/* Custom Segmented Toggle for Visibility */
.visibility-section {
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.visibility-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.custom-toggle-wrapper {
    position: relative;
    display: flex;
    background-color: #f3f4f6;
    border-radius: 12px;
    padding: 0.3rem;
    overflow: hidden;
}

.custom-toggle-wrapper input[type="radio"] {
    display: none;
}

.toggle-bg {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: calc(50% - 0.3rem);
    height: calc(100% - 0.6rem);
    background-color: #ffffff;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
}

.custom-toggle-wrapper input#visPublic:checked ~ label[for="visPublic"] {
    color: var(--text-dark);
}

.custom-toggle-wrapper input#visPrivate:checked ~ label[for="visPrivate"] {
    color: var(--text-dark);
}

/* Submit Button */
.btn-submit-post {
    margin-top: 1rem;
    padding: 1.25rem;
    font-size: 1.15rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* My Uploads Section (in Make View) */
.my-uploads-section {
    margin-top: 2rem;
    padding-top: 1rem;
}

.section-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.my-uploads-header {
    margin-bottom: 1.5rem;
}

.my-uploads-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.my-uploads-header p {
    font-size: 0.95rem;
    color: #6b7280;
}

.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #fff;
    pointer-events: none;
}

.status-badge.public {
    background: rgba(0, 0, 0, 0.4); /* Sophisticated black semi-transparency */
}

.status-badge.private {
    background: rgba(0, 0, 0, 0.65); /* Slightly darker for private badge */
}

.mini-card-title {
    padding: 1rem 0.8rem 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: left;
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-card-actions {
    display: flex;
    padding: 0 0.5rem 0.8rem;
    gap: 0.4rem;
    background: #fff;
}

.btn-micro {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: center;
}

.btn-micro:hover {
    background: #e5e7eb;
    color: var(--text-dark);
    transform: translateY(-1px);
}

.edit-btn {
    color: var(--text-dark);
}

.delete-btn {
    color: #ef4444;
}

.delete-btn:hover {
    background: #ef4444 !important;
    color: #fff !important;
}

/* --- Login Modal Styles (Premium Glassmorphism & Dark elements) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center; /* Initial center */
    padding: 20px; /* Safety padding for tall content */
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto; /* Fallback scrolling for the backdrop itself */
}

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

.modal-content {
    background: #ffffff;
    width: calc(100% - 40px);
    max-width: 480px;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    position: relative;
    text-align: center;
    border: 1px solid #e5e7eb;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* --- Settings Page Styles --- */
.settings-page-bg {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.settings-container-page {
    max-width: 800px;
    width: 100%;
    margin-top: 40px;
    margin-bottom: 60px;
    padding: 0 1.5rem;
}

.settings-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.settings-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.settings-page-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-card {
    padding: 2.5rem 0;
}

.settings-card:last-child {
    border-bottom: none;
}

.text-danger {
    color: #ef4444 !important;
}

.danger-zone {
    margin-top: 1rem;
}

.btn-danger-outline {
    border: 1px solid #fee2e2 !important;
    background-color: #ffffff !important;
    color: #ef4444 !important;
}

.btn-danger-outline:hover {
    background-color: #fef2f2 !important;
    border-color: #ef4444 !important;
}

.settings-card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1.25rem;
}

.settings-card-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.settings-card-info p {
    font-size: 0.95rem;
    color: #6b7280;
}

.settings-card-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Settings Footer (Minimalist Deletion) */
.settings-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.settings-footer-text {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.btn-text-danger {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.btn-text-danger:hover {
    color: #dc2626;
    background-color: #fef2f2;
}

/* Compact Modal Refinement */
.modal-compact {
    max-width: 360px !important;
    text-align: center;
    padding: 2.5rem 2rem !important;
}

.modal-icon-danger {
    width: 60px;
    height: 60px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-subtitle-compact {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.modal-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-ghost {
    background: none;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.btn-ghost:hover {
    background: #f9fafb;
}





.modal-overlay.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0,0,0,0.04);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.55rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.close-btn:hover {
    background: #000000;
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
}

.modal-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.modal-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
}

.input-group input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

.input-hint {
    font-size: 0.8rem;
    font-weight: 500;
    display: none; /* Hide when not in use */
}

.input-hint.error, .input-hint.success {
    display: block;
    margin-top: 0.4rem;
}

.input-hint.error {
    color: #ef4444;
}

.input-hint.success {
    color: #10b981;
}

.btn-primary {
    width: 100%;
    padding: 1.1rem;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 1rem;
    font-family: inherit;
}

.btn-primary:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 1.1rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #ef4444 !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
}

.modal-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: #6b7280;
}

#toggleAuthMode {
    cursor: pointer;
    transition: color 0.2s ease;
}

#toggleAuthMode:hover {
    color: var(--text-dark);
}

#toggleAuthMode b {
    color: var(--text-dark);
    font-weight: 600;
}

/* --- SPA View Transition Animations --- */
.fade-in {
    animation: fadeInAnimation 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInAnimation {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Share My Phostory Styles --- */
.share-page-bg {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.share-container {
    max-width: 800px;
    width: 100%;
    padding: 30px 20px;
}

@media (min-width: 768px) {
    .share-container {
        padding: 40px 60px;
        margin-top: 20px;
        margin-bottom: 40px;
    }
}

.share-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.share-header h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

@media (max-width: 480px) {
    .share-header h2 {
        font-size: 1.8rem;
    }
}

.share-link-section, .preview-section {
    margin-bottom: 2.5rem;
}

.share-link-section h3, .preview-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.preview-desc {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.link-box {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.link-box input {
    flex: 1;
    min-width: 0; /* CRITICAL: Allows flex child to shrink on mobile */
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.05rem;
    background-color: #ffffff;
    color: #4b5563;
    outline: none;
    width: 100%;
}

@media (max-width: 480px) {
    .link-box input {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
}

.btn-copy {
    flex-shrink: 0; /* CRITICAL: Prevents button from being squeezed */
    padding: 0 1.2rem;
    background-color: var(--text-dark);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .btn-copy {
        padding: 0 1rem;
        font-size: 0.9rem;
    }
}

.btn-copy:hover {
    background-color: #374151;
}

/* Browser Mockup Styles */
.browser-mockup {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    overflow: hidden;
}

.browser-header {
    background: #f3f4f6;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.browser-dots {
    display: flex;
    gap: 6px;
    margin-right: 1.5rem;
}

.browser-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d1d5db;
}

.browser-dots span:nth-child(1) { background: #ff5f56; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #27c93f; }

.browser-url {
    background: #ffffff;
    border-radius: 6px;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    color: #4b5563;
    flex: 1;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.browser-body {
    padding: 2rem;
    background: #ffffff;
    max-height: 500px;
    overflow-y: auto;
}

/* Mobile responsive adjustments for the mockup */
@media (max-width: 600px) {
    .browser-mockup {
        width: 100%;
        margin: 0;
    }
    
    .browser-header {
        padding: 0.5rem 0.7rem;
        gap: 8px;
    }
    
    .browser-dots {
        gap: 4px;
        margin-right: 0.5rem;
    }
    
    .browser-dots span {
        width: 8px;
        height: 8px;
    }
    
    .browser-url {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .browser-body {
        padding: 1.5rem 1rem;
        max-height: 400px;
    }

    .profile-hero {
        margin-bottom: 20px;
    }

    .profile-avatar-wrap {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .profile-name {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }

    .profile-bio {
        font-size: 0.85rem;
    }

    .mini-masonry {
        column-count: 2;
        column-gap: 8px;
    }
}

.profile-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.profile-avatar-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.profile-bio {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.mini-masonry {
    column-count: 3;
    column-gap: 1.25rem;
    padding-top: 0.5rem;
}

.detail-photo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: default;
    background: #f8fafc;
}

.detail-photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.detail-photo-card img {
    width: 100%;
    display: block;
    aspect-ratio: auto;
    object-fit: cover;
}

.detail-vignette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-photo-card:hover .detail-vignette {
    opacity: 1;
}

.btn-detail-delete {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-detail-delete:hover {
    background: #ec4899;
    transform: scale(1.05);
}

.mini-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.mini-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.mini-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.mini-card:hover img {
    transform: scale(1.04);
}

@media (max-width: 600px) {
    .mini-masonry {
        column-count: 2;
    }
}

/* --- Profile Edit Styles --- */
.profile-edit-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.profile-edit-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #f9fafb;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.edit-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn-small {
    padding: 0.6rem 1.2rem !important;
    font-size: 0.9rem !important;
    width: auto !important;
}

/* --- Toast Notification System --- */
.toast-container {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.9rem 1.75rem;
    border-radius: 50px; /* Pill shape for premium feel */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    max-width: 90vw;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(-20px);
    opacity: 0;
    animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.error {
    background: rgba(255, 87, 87, 0.1);
    backdrop-filter: blur(15px);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.toast.success {
    background: rgba(34, 197, 94, 0.1);
    backdrop-filter: blur(15px);
    border-color: rgba(34, 197, 94, 0.2);
    color: #10b981;
}

.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.out {
    animation: toast-out 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* --- Added Animations --- */
.fade-in {
    opacity: 0;
    animation: fadeInAnimation 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInAnimation {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --- Admin Dashboard Styles --- */
.admin-page-bg {
    background-color: var(--bg-color);
}

.admin-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .admin-container {
        display: grid;
        grid-template-areas: 
            "header header"
            "tabs content";
        grid-template-columns: 240px 1fr;
        gap: 2.5rem;
        align-items: start;
    }
}

.admin-header {
    grid-area: header;
    margin-bottom: 2.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.5rem;
}

.admin-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Tab Navigation */
.admin-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1px;
}

@media (min-width: 1024px) {
    .admin-tabs {
        grid-area: tabs;
        flex-direction: column;
        border-bottom: none;
        border-right: 1px solid #f1f5f9;
        margin-bottom: 0;
        padding-right: 1.5rem;
        gap: 0.25rem;
    }
}

.admin-tab {
    padding: 0.8rem 1rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-align: left;
    border-radius: 8px;
}

.admin-tab:hover {
    color: var(--text-dark);
    background-color: #f8fafc;
}

.admin-tab.active {
    color: var(--text-dark);
    background-color: #f1f5f9;
}

.admin-tab.active::after {
    display: none; /* Removed the underline in favor of pill background */
}

@media (max-width: 1023px) {
    .admin-tab.active {
        background: none;
        color: var(--text-dark);
    }
    .admin-tab.active::after {
        display: block;
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: var(--text-dark);
    }
}

#adminTabContent {
    grid-area: content;
    min-width: 0; /* Overflow fix for grid */
}

/* Management Tables */
.admin-table-container {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.admin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 500px; /* Prevent total collapse on tiny screens */
}

.admin-table th {
    padding: 1rem 1.5rem;
    background-color: #fdfdfd;
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table td {
    padding: 1.5rem;
    border-bottom: 1px solid #f8fafc;
    font-size: 0.95rem;
    color: var(--text-dark);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background-color: #f9fafb;
}

/* User Info Cell */
.user-info-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-username {
    font-weight: 600;
    color: var(--text-dark);
}

.user-email-small {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Photo Info Cell */
.photo-info-cell {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.photo-thumb-mini {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.btn-table-delete {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-table-delete:hover {
    background-color: #fff1f2;
    color: #e11d48;
    transform: scale(1.1);
}

/* --- Unified Role Badges (Premium Monochromatic) --- */
.badge {
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-operator {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}

.badge-admin {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-developer {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-user {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Floating badges in detail modals */
.role-badge-floating {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.role-operator { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.role-admin { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.role-developer { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.role-user { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.photo-cell-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.photo-title-main {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.photo-id-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin { background-color: #fdf2f8; color: #db2777; }
.badge-user { background-color: #f3f4f6; color: #6b7280; }
.badge-public { background-color: #ecfdf5; color: #059669; }
.badge-private { background-color: #fffbeb; color: #d97706; }

/* Dashboard Actions */
.admin-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-table-action {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-table-action:hover {
    background-color: #fef2f2;
}

.btn-table-action:disabled {
    opacity: 0.5;
    cursor: wait;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover td {
    background-color: #f8fafc !important;
}

.post-count-badge {
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .admin-header h2 { font-size: 1.6rem; }
    .admin-tabs { 
        gap: 0.8rem; 
        margin-bottom: 1.5rem;
    }
    .admin-tab { font-size: 0.9rem; }
    .admin-table th, .admin-table td {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

/* --- Admin User Detail Modal (Premium Redesign) --- */
.admin-detail-modal {
    max-width: 900px !important;
    width: 95% !important;
    max-height: 92vh !important;
    padding: 0 !important;
    border-radius: 28px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.2);
    overflow-y: auto !important; /* Internal scrolling if content is long */
    display: flex;
    flex-direction: column;
}

.user-detail-header-premium {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .user-detail-header-premium {
        flex-direction: row;
        text-align: left;
        padding: 2.5rem 3rem;
        gap: 2rem;
    }
}

.detail-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.role-badge-floating {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 30%);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.role-admin {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid rgba(219, 39, 119, 0.1);
}

.role-user {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid rgba(75, 85, 99, 0.1);
}

.detail-title-container h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

/* Stats Card */
.user-stats-card {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #ffffff;
    border-radius: 0;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
    margin-bottom: 0;
}

.user-content-section {
    padding: 2.5rem;
    background: #ffffff;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
}

/* Content Section */
.user-content-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    text-align: center;
}

.empty-state-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 0;
    color: #94a3b8;
}

.empty-state-wrap svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-wrap p {
    font-size: 0.95rem;
    font-weight: 300;
}

/* --- Admin Console Interface (Minimalist Light Mode) --- */
.admin-console-section {
    margin: 1.5rem;
    background: #ffffff; 
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    overflow: hidden;
    flex-shrink: 0;
}

.console-window-header {
    background: #f8fafc;
    padding: 0.7rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.console-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0 !important;
}

.admin-console-section .console-input-wrap {
    margin: 1rem;
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    overflow: hidden; /* Prevent child bleeding */
    padding-right: 4px; /* Space for the button */
}

.console-input-wrap:focus-within {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.console-prompt {
    padding-left: 1rem;
    color: #000000;
    font-weight: 700;
    font-size: 0.9rem;
}

#adminCommandInput {
    flex: 1;
    min-width: 0; /* CRITICAL: Allows input to shrink on mobile */
    background: transparent;
    border: none !important;
    padding: 0.85rem 0.5rem 0.85rem 0.8rem;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none !important;
    box-shadow: none !important;
}

#adminCommandInput::placeholder {
    color: #475569;
}

#btnRunCommand {
    background: var(--text-dark);
    color: #ffffff;
    border: none;
    height: 38px;
    padding: 0 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 5px;
    flex-shrink: 0; /* Prevent shrinking on mobile */
}

#btnRunCommand:hover {
    background: #333333;
    transform: scale(1.02);
}

#btnRunCommand:active {
    transform: scale(0.98);
}

.console-help {
    margin: 0 1.25rem 1rem 1.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

.console-help strong {
    color: #94a3b8;
}

.admin-modal-actions {
    display: flex;
    justify-content: center;
    padding: 2rem;
    margin-top: 0;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

#closeUserDetailModalAlt {
    width: auto !important;
    min-width: 200px;
    padding: 0.9rem 2.5rem !important;
    border-radius: 50px !important; /* Elegant pill shape */
    margin: 0 !important;
}

/* --- Refined Custom Scrollbar for Admin Detail Modal --- */
.admin-detail-modal::-webkit-scrollbar {
    width: 8px;
}

.admin-detail-modal::-webkit-scrollbar-track {
    background: transparent;
    margin: 15px 0; /* Ensures scrollbar doesn't hit the rounded edges */
}

.admin-detail-modal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid #ffffff; /* Contrast border */
}

.admin-detail-modal::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.btn-action-reset, .btn-action-close {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1.1rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
}

.btn-action-reset {
    background-color: #f1f5f9;
    color: #3b82f6;
}

.btn-action-reset:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

.btn-action-close {
    background-color: var(--text-dark);
    color: #ffffff;
}

.btn-action-close:hover {
    background-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- Admin User Detail Modal Mobile Optimization --- */
@media (max-width: 600px) {
    .admin-detail-modal { 
        padding: 2rem 1.25rem; 
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 20px;
    }

    .detail-avatar-container { margin-bottom: 1rem; }
    .profile-avatar-large { width: 90px; height: 90px; }
    
    .detail-title-container h2 { 
        font-size: 1.6rem; 
        line-height: 1.2;
    }

    .user-stats-card { 
        flex-direction: column; 
        gap: 1.25rem; 
        padding: 1.5rem 1rem; 
        margin-bottom: 2rem;
    }

    .stat-item {
        width: 100%;
    }

    .stat-divider { 
        width: 50%; 
        height: 1px; 
        background: #e2e8f0;
    }

    .user-content-section h3 { 
        font-size: 1.1rem; 
        margin-bottom: 1.25rem; 
    }

    .empty-state-wrap { padding: 2rem 0; }
    .empty-state-wrap svg { width: 32px; height: 32px; }

    .admin-modal-actions { 
        flex-direction: column; 
        gap: 0.8rem;
    }

    .btn-action-reset, .btn-action-close { 
        width: 100%;
        padding: 0.9rem;
        font-size: 0.95rem;
    }
}

/* User table row clickable style */
.admin-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.admin-table tbody tr:hover td {
    background-color: #f9fafb;
}

/* --- Custom Scrollbar for Admin Detail Modal --- */
.admin-detail-modal::-webkit-scrollbar {
    width: 6px;
}

.admin-detail-modal::-webkit-scrollbar-track {
    background: transparent;
}

.admin-detail-modal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.admin-detail-modal::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Refined Admin Photo Detail Modal (V2) --- */
.admin-photo-detail-modal-v2 {
    max-width: 850px !important;
    width: 95% !important;
    max-height: 92vh !important;
    padding: 0 !important;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.2);
    overflow: hidden; 
    display: flex;
    flex-direction: column;
}

@media (min-width: 900px) {
    .admin-photo-detail-modal-v2 {
        flex-direction: row;
        height: auto;
        min-height: 500px;
    }
}

.admin-photo-header { display: none; }

.admin-photo-preview-v2 {
    flex: 1.2;
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    position: relative;
    border-right: 1px solid #f1f5f9;
}

.admin-photo-preview-v2 img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.admin-photo-body {
    flex: 1;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    position: relative;
}

@media (max-width: 900px) {
    .admin-photo-detail-modal-v2 {
        max-height: 96vh !important;
    }
    .admin-photo-preview-v2 {
        flex: none;
        padding: 2.5rem;
        background: #ffffff;
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        height: auto; /* Removed fixed 300px */
    }
    .admin-photo-preview-v2 img {
        max-height: 45vh;
    }
    .admin-photo-body {
        padding: 2rem;
        text-align: left;
    }
}








.admin-photo-body .admin-form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.admin-photo-body .admin-form-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

@media (max-width: 899px) {
    .admin-photo-body .admin-form-group {
        text-align: center;
    }
}

/* Redesigned Slim Toggle - Precision Centering */
.admin-toggle-slim {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    display: flex;
    position: relative;
    background-color: #f1f5f9;
    border-radius: 12px;
    padding: 0.2rem;
}

.admin-toggle-slim .toggle-bg {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    height: calc(100% - 0.4rem);
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toggle-slim input { display: none; }

.admin-toggle-slim .toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease;
    margin: 0 !important;
    padding: 0.6rem 0 !important; /* Balanced padding for vertical centering */
}

.admin-toggle-slim input#adminVisPublic:checked ~ label[for="adminVisPublic"],
.admin-toggle-slim input#adminVisPrivate:checked ~ label[for="adminVisPrivate"] {
    color: var(--text-dark);
}

.admin-photo-body .admin-form-group input {
    width: 100%;
    max-width: 320px;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.95rem;
    color: var(--text-dark);
    text-align: center;
    background: #fdfdfd;
    transition: all 0.2s ease;
}

.admin-photo-body .admin-form-group input:focus, 
.admin-photo-body .admin-form-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.admin-meta-info {
    border-top: 1px solid #f1f5f9;
    padding-top: 2rem;
    margin-top: 1rem;
    margin-bottom: 2.5rem;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.6;
}

.admin-meta-info div {
    margin-bottom: 0.5rem;
}

.admin-meta-info strong {
    color: var(--text-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    display: inline-block;
    width: 90px;
}

.meta-item.full-width {
    width: 100%;
}

.date-sub-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 0.4rem;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.admin-photo-actions-v2 {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .admin-photo-actions-v2 {
        grid-template-columns: 1fr;
    }
}

/* Use global .close-btn */

.btn-save-photo-v2, .btn-delete-photo-v2 {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-save-photo-v2 {
    background: var(--text-dark);
    color: white;
}

.btn-save-photo-v2:hover {
    background: #333;
    transform: translateY(-2px);
}

.btn-delete-photo-v2 {
    background: #fff5f5;
    color: #e53e3e;
}

.btn-delete-photo-v2:hover {
    background: #fed7d7;
    transform: translateY(-2px);
}

/* --- Mobile Responsiveness for Photo Detail --- */
@media (max-width: 600px) {
    .admin-photo-detail-modal-v2 {
        width: 95%;
        max-height: 92vh;
        overflow-y: auto;
        border-radius: 20px;
    }

    .admin-photo-header {
        padding: 1rem 1.25rem;
    }
    
    .admin-photo-header h2 { font-size: 1.1rem; }
    
    .admin-photo-preview-v2 img {
        max-height: 250px;
    }

    .admin-photo-body {
        padding: 1.5rem 1.25rem;
    }

    .admin-photo-body .admin-form-group {
        margin-bottom: 1.5rem;
    }

    .admin-meta-info {
        gap: 1.5rem;
        flex-direction: column;
        align-items: center;
        padding-top: 1rem;
        margin-bottom: 2rem;
    }

    .admin-photo-actions-v2 {
        flex-direction: column;
        gap: 0.8rem;
    }

    .btn-save-photo-v2, .btn-delete-photo-v2 {
        max-width: 100%;
        padding: 0.9rem;
    }
}
