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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Form Button Container */
.form-button-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.open-form-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: white;
    color: #06b6d4;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.open-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.form-note {
    color: white;
    margin-top: 1rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Google Form Container */
.google-form-container {
    width: 100%;
    max-width: 100%;
    margin: 2rem auto 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#googleFormIframe {
    width: 100%;
    min-height: 1200px;
    border: none;
}

.form-instructions {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #ecfeff;
    border-radius: 8px;
    color: #0891b2;
}

main {
    padding: 40px;
}

.upload-area {
    display: block;
    border: 3px dashed #06b6d4;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f0fdfa;
    position: relative;
}

.upload-area:hover {
    border-color: #6366f1;
    background: #ecfeff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #6366f1;
    background: #cffafe;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.3em;
    color: #06b6d4;
    font-weight: 600;
    margin-bottom: 10px;
    display: none; /* Hidden by default, shown on mobile */
}

.upload-text-desktop {
    font-size: 1.3em;
    color: #06b6d4;
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-hint {
    color: #888;
    font-size: 0.9em;
}

.preview-container {
    margin-top: 30px;
}

.preview-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.preview-item .video-preview {
    position: relative;
    width: 100%;
    height: 150px;
    background: #000;
    overflow: hidden;
}

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

.preview-item .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.preview-item .play-icon {
    font-size: 2.5em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.preview-item .file-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(6, 182, 212, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
}

.preview-item .file-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
}

.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.upload-btn:active {
    transform: translateY(0);
}

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

.progress-container {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    color: #666;
}

.mobile-warning {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
    color: #92400e;
    font-size: 0.9em;
}

.mobile-warning strong {
    display: block;
    margin-bottom: 4px;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Login Screen Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.login-box h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
}

.login-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.password-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.password-input:focus {
    outline: none;
    border-color: #06b6d4;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9em;
    display: none;
}

.login-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    header {
        padding: 30px 15px;
    }

    header h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }

    header p {
        font-size: 0.95em;
    }

    main {
        padding: 20px 15px;
    }

    .upload-area {
        padding: 40px 15px;
        border-width: 2px;
    }

    .upload-icon {
        font-size: 3em;
        margin-bottom: 15px;
    }

    .upload-text {
        display: block; /* Show on mobile */
        font-size: 1.1em;
    }

    .upload-text-desktop {
        display: none; /* Hide on mobile */
    }

    .upload-hint {
        font-size: 0.85em;
    }

    .preview-container {
        margin-top: 20px;
    }

    .preview-container h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        margin-bottom: 15px;
    }

    .preview-item img {
        height: 100px;
    }

    .preview-item .video-preview {
        height: 100px;
    }

    .preview-item .play-icon {
        font-size: 2em;
    }

    .preview-item .file-type-badge {
        font-size: 0.65em;
        padding: 3px 6px;
    }

    .preview-item .file-info {
        font-size: 0.7em;
        padding: 3px 6px;
    }

    .preview-item .remove-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 3px;
        right: 3px;
    }

    .upload-btn {
        padding: 18px;
        font-size: 1em;
        min-height: 48px; /* Touch-friendly minimum */
    }

    .progress-bar {
        height: 25px;
    }

    .progress-text {
        font-size: 0.9em;
    }

    .message {
        padding: 12px;
        font-size: 0.9em;
    }

    /* Login Screen Mobile */
    .login-container {
        padding: 10px;
    }

    .login-box {
        padding: 35px 25px;
        border-radius: 15px;
    }

    .login-icon {
        font-size: 3em;
        margin-bottom: 15px;
    }

    .login-box h2 {
        font-size: 1.6em;
        margin-bottom: 8px;
    }

    .login-subtitle {
        font-size: 0.9em;
        margin-bottom: 25px;
    }

    .password-input {
        padding: 18px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px; /* Touch-friendly */
        margin-bottom: 15px;
    }

    .login-btn {
        padding: 18px;
        font-size: 1em;
        min-height: 48px; /* Touch-friendly minimum */
    }

    .login-message {
        font-size: 0.85em;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .upload-area {
        padding: 30px 10px;
    }

    .upload-icon {
        font-size: 2.5em;
    }

    .upload-text {
        font-size: 1em;
    }

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

    .preview-item img {
        height: 80px;
    }

    .preview-item .video-preview {
        height: 80px;
    }

    .preview-item .play-icon {
        font-size: 1.5em;
    }

    .login-box {
        padding: 30px 20px;
    }

    .login-box h2 {
        font-size: 1.4em;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .upload-area:hover {
        transform: none;
    }

    .upload-btn:hover {
        transform: none;
    }

    .login-btn:hover {
        transform: none;
    }

    /* Larger tap targets for touch devices */
    .preview-item .remove-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* Prevent text selection on buttons for better mobile UX */
.upload-btn,
.login-btn,
.remove-btn {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

