/* ============================================
   Macchi Photography - Luxury Wedding Upload
   Cormorant Garamond + DM Sans
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    --accent: #0f4fa3;
    --accent-light: rgba(15, 79, 163, 0.08);
    --warm: #b0a090;
    --warm-light: #f0ebe4;
    --warm-border: #d4c9bb;
    --warm-muted: #9c8f82;
    --warm-text: #7a6f65;
    --divider: #c9bfb3;

    --success: #34c759;
    --success-light: rgba(52, 199, 89, 0.1);
    --error: #e53935;
    --error-light: rgba(229, 57, 53, 0.06);

    --bg: #f5f2ee;
    --bg-card: #ffffff;
    --bg-input: #f7f4f0;
    --bg-hover: #eee9e3;
    --border: #e0d8cf;
    --border-hover: #a89880;
    --text: #1a1a1a;
    --text-secondary: #6e6e73;
    --text-tertiary: #b0a090;

    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 2px 12px rgba(0,0,0,0.05);
    --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.04);

    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ============================================
   Reset
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    line-height: 1.5;
    overflow-x: hidden;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

a { color: var(--accent); text-decoration: none; }

::selection { background: var(--accent-light); }

/* ============================================
   Layout
   ============================================ */

.container {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */

.header {
    text-align: center;
    padding: 20px 0 4px;
}

.header__logo {
    max-width: 320px;
    max-height: 130px;
    margin: 0 auto 8px;
    display: block;
    opacity: 0.9;
}

.header__brand-sub {
    font-family: var(--font-body);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--warm-muted);
    margin-bottom: 14px;
    font-weight: 500;
}

.header__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.2;
}

.header__subtitle {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 340px;
    margin: 0 auto;
}

.header__date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 14px;
    background: transparent;
    border: 1px solid var(--warm-border);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--warm-text);
}

/* Decorative Divider */
.header__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px auto 16px;
    width: 100px;
}

.header__divider::before,
.header__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--divider);
}

.header__divider-diamond {
    width: 6px;
    height: 6px;
    border: 1px solid var(--divider);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ============================================
   Card
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card__title {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* ============================================
   Drop Zone - Premium
   ============================================ */

.dropzone {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    background: var(--bg-card);
    box-shadow: var(--shadow-inset);
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

.dropzone:active {
    transform: scale(0.985);
}

.dropzone.dragover {
    border-color: var(--border-hover);
    background: var(--warm-light);
}

.dropzone__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    background: var(--warm-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s var(--spring), background 0.3s var(--ease);
}

.dropzone__icon svg {
    width: 30px;
    height: 30px;
    stroke: var(--warm);
    stroke-width: 1.5;
    fill: none;
}

.dropzone:active .dropzone__icon {
    transform: scale(0.92);
}

.dropzone.dragover .dropzone__icon {
    background: var(--accent-light);
    transform: scale(1.08);
}

.dropzone.dragover .dropzone__icon svg {
    stroke: var(--accent);
}

.dropzone__text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #2a2a2a;
}

.dropzone__hint {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--warm-muted);
    font-weight: 400;
    margin-bottom: 16px;
}

.dropzone__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    background: var(--text);
    color: white;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s var(--ease);
    pointer-events: none;
}

.dropzone__input {
    display: none;
}

/* ============================================
   File List
   ============================================ */

.file-list {
    list-style: none;
    max-height: 50dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.file-list::-webkit-scrollbar { display: none; }

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    animation: fileIn 0.4s var(--ease);
}

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

.file-item + .file-item {
    border-top: 1px solid rgba(0,0,0,0.04);
}

.file-item__preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xs);
    background: var(--warm-light);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.file-item__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-item__info {
    flex: 1;
    min-width: 0;
}

.file-item__name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.file-item__meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.file-item__remove {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
    -webkit-appearance: none;
}

.file-item__remove:active {
    background: var(--error-light);
    color: var(--error);
    transform: scale(0.9);
}

/* Progress */
.file-item__progress {
    width: 100%;
    height: 3px;
    background: var(--warm-light);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.file-item__progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s var(--ease);
}

.file-item--success .file-item__progress-bar { background: var(--success); }
.file-item--error .file-item__progress-bar { background: var(--error); }

.file-item__status {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 3px;
}

.file-item__status--success { color: var(--success); }
.file-item__status--error { color: var(--error); }

.file-item__compress {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 500;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: var(--font-body);
    -webkit-appearance: none;
    min-height: 52px;
    letter-spacing: -0.01em;
}

.btn--primary {
    background: var(--text);
    color: white;
}

.btn--primary:active:not(:disabled) {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn--secondary {
    background: var(--bg-input);
    color: var(--text);
}

.btn--secondary:active:not(:disabled) {
    transform: scale(0.97);
    background: var(--bg-hover);
}

.btn--accent {
    background: var(--accent);
    color: white;
}

.btn--accent:active:not(:disabled) {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn--danger {
    background: var(--error-light);
    color: var(--error);
}

.btn--danger:active:not(:disabled) {
    background: var(--error);
    color: white;
    transform: scale(0.97);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--ghost:active:not(:disabled) {
    background: var(--bg-input);
    transform: scale(0.97);
}

.btn--full { width: 100%; }

.btn--sm {
    padding: 10px 18px;
    font-size: 0.85rem;
    min-height: 40px;
    border-radius: var(--radius-xs);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   Upload Actions
   ============================================ */

.upload-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.upload-actions__count {
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex: 1;
    font-weight: 500;
}

/* ============================================
   Add-More Zone
   ============================================ */

.add-more {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    background: transparent;
    margin-bottom: 12px;
}

.add-more:active {
    background: var(--warm-light);
    border-color: var(--border-hover);
}

.add-more__text {
    font-size: 0.85rem;
    color: var(--warm-muted);
    font-weight: 500;
}

/* ============================================
   Toast - Top Notification
   ============================================ */

.toast-container {
    position: fixed;
    top: calc(12px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 400px;
}

.toast {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    font-size: 0.88rem;
    font-weight: 500;
    animation: toastIn 0.4s var(--spring);
    pointer-events: auto;
    text-align: center;
    font-family: var(--font-body);
}

.toast--success {
    background: var(--text);
    color: white;
}

.toast--error {
    background: var(--error);
    color: white;
}

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

.toast--hide {
    animation: toastOut 0.3s var(--ease) forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

/* ============================================
   Success Screen
   ============================================ */

.success-screen {
    text-align: center;
    padding: 48px 20px;
}

.success-screen__icon {
    width: 72px;
    height: 72px;
    background: var(--success-light);
    color: var(--success);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 24px;
    animation: successPop 0.5s var(--spring);
}

@keyframes successPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.success-screen__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.success-screen__text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* ============================================
   Loading / Error
   ============================================ */

.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60dvh;
    flex-direction: column;
    gap: 16px;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-top-color: var(--warm);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.error-screen {
    text-align: center;
    padding: 80px 24px;
}

.error-screen__icon {
    font-size: 44px;
    margin-bottom: 16px;
    opacity: 0.35;
}

.error-screen__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-screen__text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    padding: 14px 0 12px;
    margin-top: auto;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.footer__powered {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
}

.footer__powered a {
    color: var(--accent);
    transition: opacity 0.2s;
}

.footer__powered a:active { opacity: 0.6; }

.footer__powered svg {
    width: 12px;
    height: 12px;
    fill: var(--accent);
}

/* ============================================
   Desktop
   ============================================ */

@media (min-width: 769px) {
    .header { padding: 72px 0 8px; }
    .header__logo { max-width: 260px; }
    .header__title { font-size: 2.6rem; }
    .dropzone { padding: 56px 32px 48px; }

    .dropzone:hover {
        border-color: var(--border-hover);
        transform: scale(1.003);
    }

    .dropzone:hover .dropzone__icon {
        transform: scale(1.04);
    }

    .dropzone:hover .dropzone__cta {
        background: var(--accent);
    }

    .btn--primary:hover:not(:disabled) { opacity: 0.85; }
    .btn--secondary:hover:not(:disabled) { background: var(--bg-hover); }
    .btn--ghost:hover:not(:disabled) { background: var(--bg-input); }
    .file-item__remove:hover { background: var(--error-light); color: var(--error); }
}
