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

:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --text-primary: rgba(0, 0, 0, 0.85);
    --text-secondary: rgba(0, 0, 0, 0.55);
    --accent: #007AFF;
    --accent-hover: #0056CC;
    --danger: #FF3B30;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
    line-height: 1.5;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(167, 139, 250, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(251, 146, 180, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(147, 197, 253, 0.4) 0%, transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    z-index: -1;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
}

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

.logo {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.tagline {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 400;
}

.credit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.credit a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.credit a:hover {
    color: var(--text-primary);
}

.about-btn {
    position: fixed;
    top: 24px;
    left: 24px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.about-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px var(--glass-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.drop-zone {
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.08);
}

.drop-zone.drag-over {
    transform: scale(1.01);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    color: var(--text-secondary);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    color: var(--accent);
    transform: translateY(-4px);
}

.drop-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.drop-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

.preview-section {
    display: none;
    margin-top: 24px;
}

.preview-section.visible {
    display: block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.photo-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.clear-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.clear-btn:hover {
    background: rgba(255, 59, 48, 0.1);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.preview-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 14px;
    line-height: 1;
}

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

.options-section {
    display: none;
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
}

.options-section.visible {
    display: block;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-option input {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 26px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.toggle-option input:checked + .toggle-switch {
    background: var(--accent);
}

.toggle-option input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.action-section {
    margin-top: 24px;
    display: none;
}

.action-section.visible {
    display: block;
}

.process-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent) 0%, #0056CC 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.4);
}

.process-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.process-btn.loading .btn-text {
    opacity: 0;
}

.process-btn.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.progress-section {
    display: none;
    margin-top: 24px;
}

.progress-section.visible {
    display: block;
}

.progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #5AC8FA);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 12px;
}

.footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
}

.footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .container {
        padding: 40px 16px;
    }

    .logo {
        font-size: 32px;
    }

    .glass-card {
        padding: 24px;
        border-radius: 20px;
    }

    .drop-zone {
        padding: 32px 16px;
    }

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

/* Success state animation */
@keyframes success-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.glass-card.success {
    animation: success-pulse 0.5s ease;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 24px;
}

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

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-content p:last-of-type {
    margin-bottom: 0;
}

.modal-credit {
    margin-top: 24px !important;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-credit a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.modal-credit a:hover {
    opacity: 0.7;
}

.modal-version {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.35);
    margin-top: 16px !important;
}
