/* ============================================
   NIŞAN FOTOĞRAF SİSTEMİ - APPLE PHOTOS STYLE
   Colors: #ede7db (background) #676c59 (accent)
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ede7db;
    --bg-light: #f5f1e8;
    --bg-card: #ffffff;
    --accent: #676c59;
    --accent-hover: #565a4a;
    --accent-light: rgba(103, 108, 89, 0.1);
    --accent-lighter: rgba(103, 108, 89, 0.05);
    --text: #2c2c2c;
    --text-secondary: #6b6b6b;
    --text-light: #999;
    --border: rgba(103, 108, 89, 0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(103, 108, 89, 0.3);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(103, 108, 89, 0.4);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(103, 108, 89, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}
.btn-danger:hover {
    background: #a93226;
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: var(--accent);
    padding: 8px 16px;
    border: none;
}
.btn-text:hover {
    background: var(--accent-light);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
}

/* ============================================
   GUEST UPLOAD PAGE
   ============================================ */
.guest-page {
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Center vertically only when content fits */
@media (min-height: 700px) {
    .guest-page:not(.has-previews) {
        align-items: center;
    }
}

/* Decorative background circles */
.deco-circle {
    position: fixed;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.03;
    pointer-events: none;
}
.deco-circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}
.deco-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
    animation: float 25s ease-in-out infinite reverse;
}
.deco-circle-3 {
    width: 200px;
    height: 200px;
    top: 40%;
    left: 50%;
    animation: float 15s ease-in-out infinite 5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -30px); }
    50% { transform: translate(-15px, 20px); }
    75% { transform: translate(25px, 10px); }
}

.container {
    width: 100%;
    max-width: 520px;
    position: relative;
    z-index: 1;
}

.guest-header {
    text-align: center;
    margin-bottom: 32px;
}

.rings-icon {
    margin-bottom: 16px;
    animation: fadeInDown 0.8s ease-out;
}

.guest-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    animation: fadeInDown 0.8s ease-out 0.1s both;
}

.guest-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    animation: fadeIn 1s ease-out 0.3s both;
}

.divider::before, .divider::after {
    content: '';
    height: 1px;
    width: 60px;
    background: var(--border);
}

.divider-leaf {
    margin: 0 16px;
    color: var(--accent);
    font-size: 1.2rem;
}

/* Upload Zone */
.upload-section {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.upload-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-lighter);
    opacity: 0;
    transition: opacity var(--transition);
}

.upload-zone:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone.drag-over {
    border-color: var(--accent);
    border-style: solid;
    background: rgba(103, 108, 89, 0.05);
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

.upload-zone.drag-over::before {
    opacity: 1;
}

.upload-zone-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    margin-bottom: 16px;
    opacity: 0.7;
    transition: all var(--transition);
}

.upload-zone:hover .upload-icon {
    opacity: 1;
    transform: translateY(-4px);
}

.upload-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Preview Area */
.preview-area {
    margin-top: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
}

.preview-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-item .remove-preview {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.preview-item:hover .remove-preview {
    opacity: 1;
}

.btn-upload {
    width: 100%;
}

/* Progress */
.progress-container {
    margin-top: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
}

.success-modal .success-icon {
    margin-bottom: 20px;
    animation: checkBounce 0.5s ease 0.2s both;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.modal-subtext {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-header {
    margin-bottom: 28px;
}

.login-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-top: 12px;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.login-form {
    text-align: left;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-light);
    color: var(--text);
    transition: all var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.toggle-password:hover {
    opacity: 0.8;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: left;
}

.alert-error {
    background: #fef2f2;
    color: #c0392b;
    border: 1px solid #fecaca;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

/* ============================================
   ADMIN PAGE
   ============================================ */
.admin-page {
    min-height: 100dvh;
    background: var(--bg-light);
}

.admin-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.admin-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.admin-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-stats {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Toolbar */
.admin-toolbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 52px;
    z-index: 99;
}

.admin-toolbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.select-all-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.select-all-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.selected-count {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.toolbar-right {
    display: flex;
    gap: 8px;
}

/* Photo Grid */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.photo-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    cursor: pointer;
}

.photo-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.photo-card.selected {
    box-shadow: 0 0 0 3px var(--accent), var(--shadow-md);
}

.photo-card.selected .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.photo-card.selected .checkmark::after {
    display: block;
}

/* Photo checkbox */
.photo-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.photo-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: none;
}

.photo-checkbox:hover .checkmark {
    border-color: var(--accent);
    background: rgba(103, 108, 89, 0.3);
}

/* Photo Thumbnail */
.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--bg);
    transition: transform 0.4s ease;
}

.photo-card:hover .photo-thumb {
    transform: scale(1.05);
}

.heic-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Video */
.video-thumb-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.video-thumb-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 5;
}

.preview-item .video-badge {
    bottom: 4px;
    left: 4px;
    font-size: 0.6rem;
    padding: 2px 6px;
}

.photo-info {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.photo-size {
    font-size: 0.72rem;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state h2 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.92);
    animation: fadeIn 0.2s ease;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    animation: scaleIn 0.2s ease;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.25);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.25);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-info {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    background: rgba(0,0,0,0.5);
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes checkBounce {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .guest-title {
        font-size: 1.6rem;
    }
    
    .upload-zone {
        padding: 36px 20px;
    }
    
    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .admin-nav-inner {
        padding: 10px 14px;
    }
    
    .admin-logo {
        font-size: 0.95rem;
    }
    
    .admin-stats {
        display: none;
    }
    
    .admin-toolbar-inner {
        padding: 8px 14px;
    }
    
    .admin-main {
        padding: 12px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    
    .photo-card {
        border-radius: var(--radius-sm);
    }
    
    .photo-info {
        padding: 6px 8px;
    }
    
    .photo-date, .photo-size {
        font-size: 0.65rem;
    }
    
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
    
    .modal-content {
        padding: 32px 24px;
        margin: 16px;
    }
    
    .toolbar-right .btn-sm {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    /* On mobile, always show remove button */
    .preview-item .remove-preview {
        opacity: 1;
    }
}

@media (max-width: 380px) {
    .guest-title {
        font-size: 1.4rem;
    }
    
    .upload-zone {
        padding: 28px 16px;
        border-radius: var(--radius-lg);
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(103, 108, 89, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(103, 108, 89, 0.4);
}
