/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --bg-primary: #1a1d24;
    --bg-secondary: #23272f;
    --bg-tertiary: #2d3139;
    --bg-hover: #353942;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a4ab;
    --text-muted: #6b7280;
    
    --accent-primary: #ef4444;
    --accent-hover: #dc2626;
    --accent-light: rgba(239, 68, 68, 0.1);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1d24 0%, #23272f 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.5s ease-out;
}

.screen.active {
    display: block;
}

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

/* Container */
.container {
    width: 100%;
}

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

.cloud-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

/* Password Form */
.password-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 10px 40px var(--shadow);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 14px 48px 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-primary);
}

.eye-icon {
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-browse,
.btn-send {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-browse {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--accent-primary);
    padding: 12px 24px;
    width: auto;
}

.btn-browse:hover {
    background: var(--accent-light);
}

.btn-send {
    background: var(--accent-primary);
    color: white;
    margin-top: 24px;
}

.btn-send:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.btn-logout {
    margin-top: 24px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-logout:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Error Message */
.error-message {
    color: var(--accent-primary);
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Drop Zone */
.drop-zone {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

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

.upload-icon {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

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

.drop-limit {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* File List */
.file-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item:hover {
    background: var(--bg-tertiary);
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

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

.file-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-muted);
    font-size: 13px;
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.file-remove:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* Message Section */
.message-section {
    margin-top: 24px;
    animation: slideIn 0.3s ease-out;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.char-counter {
    text-align: right;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 24px;
    animation: slideIn 0.3s ease-out;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-info span {
    font-size: 14px;
    font-weight: 500;
}

#progressText {
    color: var(--text-primary);
}

#progressPercent {
    color: var(--accent-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

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

/* Success Message */
.success-message {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    animation: slideIn 0.3s ease-out;
}

.success-icon {
    color: var(--success);
    margin-bottom: 16px;
}

.success-message h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .password-form {
        padding: 24px;
    }
    
    .drop-zone {
        padding: 32px 20px;
    }
    
    .cloud-icon {
        font-size: 40px;
    }
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}
