/* Main CSS - Upload Page */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --error: #f56565;
    --warning: #ed8936;
    --bg-dark: #1a1a2e;
    --bg-darker: #16213e;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --radius: 16px;
    --radius-sm: 8px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 0 30px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Upload Section */
.upload-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.upload-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Drop Zone */
.drop-zone {
    position: relative;
    flex: 1;
    min-height: 300px;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.drop-zone-content {
    text-align: center;
    padding: 40px;
}

.camera-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--primary);
}

.camera-icon svg {
    width: 100%;
    height: 100%;
}

.drop-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Preview */
.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-darker);
    padding: 10px;
    overflow: hidden;
}

.preview-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    overflow-y: auto;
    padding: 5px;
}

.preview-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

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

.remove-thumb {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.remove-thumb:hover {
    background: var(--error);
}

.clear-all-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-all-btn:hover {
    background: var(--error);
    border-color: var(--error);
}

/* Photo count */
.photo-count {
    text-align: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-weight: 500;
}

/* Caption */
.caption-section {
    margin-top: 16px;
}

.caption-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.3s;
}

.caption-input::placeholder {
    color: var(--text-secondary);
}

.caption-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Upload Button */
.upload-btn {
    margin-top: 20px;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.upload-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.btn-text,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Progress Bar */
.progress-container {
    margin-top: 16px;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    height: 30px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 14px;
}

/* Status Message */
.status-message {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
}

.status-message.success {
    background: rgba(72, 187, 120, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.status-message.error {
    background: rgba(245, 101, 101, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-message {
    animation: fadeIn 0.3s ease;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 28px;
    }

    .drop-zone {
        min-height: 250px;
    }

    .camera-icon {
        width: 60px;
        height: 60px;
    }

    .drop-text {
        font-size: 18px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 20px 0 15px;
    }

    .header h1 {
        font-size: 24px;
    }

    .drop-zone {
        min-height: 150px;
    }
}
