* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

@supports (padding: max(0px)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
        padding-top: env(safe-area-inset-top);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 28px;
    padding: 40px 32px;
    max-width: 400px;
    width: 90vw;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    text-align: center;
    margin-bottom: 24px;
    color: #333;
}

.error {
    color: #ea4335;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form input {
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 16px;
}
/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    padding: 12px 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    text-align: center;
}

.header-btn:active {
    transform: scale(0.98);
    background: rgba(102, 126, 234, 0.2);
}

/* Main container */
.container {
    max-width: 100%;
    padding: 20px 16px;
    padding-top: 80px;
    padding-bottom: 40px;
}
/* Main card */
.main-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 28px;
    padding: clamp(24px, 8vw, 40px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15);
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 100%;
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0s 1 both;
}

.main-card h1 {
    font-size: clamp(24px, 8vw, 36px);
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.subtitle {
    color: #666;
    font-size: clamp(14px, 4vw, 16px);
    margin-bottom: clamp(24px, 6vw, 36px);
    line-height: 1.6;
}

/* Drop zone */
.drop-zone {
    border: 3px dashed transparent;
    border-radius: 24px;
    padding: clamp(40px, 15vw, 70px) 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: translateX(-120%) translateY(-120%) rotate(45deg);
    transition: transform 0.8s;
    border-radius: 24px;
}

.drop-zone.dragover {
    border-color: #34a853 !important;
    background: linear-gradient(
        135deg,
        rgba(52, 168, 83, 0.15),
        rgba(102, 126, 234, 0.1)
    );
    transform: scale(1.03);
    box-shadow: 0 20px 60px rgba(52, 168, 83, 0.2);
}

.drop-zone.dragover::before {
    transform: translateX(120%) translateY(120%) rotate(45deg);
}

.drop-icon {
    font-size: clamp(48px, 18vw, 72px);
    margin-bottom: 16px;
    opacity: 0.85;
    transition: transform 0.3s;
}

.drop-icon.rotating {
    transform: scale(1.1) rotate(10deg);
}
/* File list */
.file-list {
    background: rgba(248, 249, 250, 0.9);
    border-radius: 20px;
    padding: clamp(16px, 4vw, 24px);
    margin: 20px 0;
    min-height: 80px;
    display: grid;
    gap: 12px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-weight: 600;
    font-size: clamp(14px, 4vw, 16px);
    min-height: 52px;
}

.file-size {
    color: #666;
    font-size: 0.85em;
}

.file-remove {
    background: #ea4335;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    touch-action: manipulation;
}

.file-remove:active {
    transform: scale(0.95);
}

/* Create button */
.create-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: clamp(20px, 6vw, 24px) clamp(32px, 12vw, 48px);
    border-radius: 28px;
    font-size: clamp(16px, 5vw, 20px);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 100%;
    min-height: 64px;
    touch-action: manipulation;
}

.create-btn:hover:not(:disabled),
.create-btn:active:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.5);
}

.create-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress */
.progress {
    display: none;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: clamp(24px, 6vw, 32px);
    margin: 24px 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.progress-text {
    font-size: clamp(16px, 4.5vw, 18px);
    font-weight: 700;
    margin-bottom: 20px;
}

.progress-bar {
    height: clamp(12px, 3vw, 16px);
    background: rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #34a853, #fbbc04);
    background-size: 300% 100%;
    border-radius: 12px;
    width: 0%;
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}
/* History */
.history-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    padding: clamp(24px, 6vw, 36px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    margin-top: 24px;
    animation: fadeInUp 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s 1 both;
}

.history-title {
    font-size: clamp(18px, 5vw, 24px);
    margin-bottom: 24px;
    color: #333;
    font-weight: 700;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: rgba(102, 126, 234, 0.12);
    border-radius: 20px;
    margin-bottom: 16px;
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 500;
}

.history-item:last-child {
    margin-bottom: 0;
}

/* Mobile breakpoints */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        padding-top: 70px;
    }
    .header {
        padding: 12px 12px;
    }
    .header-buttons {
        gap: 4px;
    }
    .header-btn {
        padding: 6px 12px;
        min-width: 70px;
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 500px;
        margin: 0 auto;
        padding: 24px 20px;
    }
    .drop-zone {
        max-width: 450px;
        margin: 0 auto;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
