/**
 * V6D FileCloud - Styles
 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252540;
    --bg-input: #12121f;
    --text: #f1f1f1;
    --text-muted: #9ca3af;
    --border: #2d2d44;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-light);
    text-decoration: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Form Elements ========== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Autofill styling for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    border: 1px solid var(--border) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-icon {
    padding: 8px;
    background: transparent;
    color: var(--text-muted);
}

.btn-icon:hover {
    color: var(--primary-light);
    background: var(--bg-card-hover);
}

.btn-danger:hover {
    color: var(--error) !important;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.logo i {
    color: var(--primary);
    font-size: 24px;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== Landing Page ========== */
.landing-page {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a3e 100%);
}

.hero {
    min-height: 100vh;
    padding: 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-links {
    display: flex;
    gap: 12px;
}

.hero-content {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.floating-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: float 3s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: 0.5s;
}

.floating-card:nth-child(3) {
    animation-delay: 1s;
}

.floating-card i {
    font-size: 24px;
    color: var(--primary);
}

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

/* Features */
.features {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 28px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ========== Auth Pages ========== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}

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

.auth-header .logo {
    justify-content: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
}

.auth-links a {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-links a:hover {
    color: var(--primary-light);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* Input with Icon */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon input {
    padding-left: 42px;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* ========== Dashboard ========== */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    color: var(--text-muted);
    font-size: 14px;
}

.dashboard {
    padding: 32px 20px;
}

/* Storage Card */
.storage-card {
    margin-bottom: 24px;
}

.storage-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.storage-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.storage-icon i {
    font-size: 24px;
    color: var(--primary);
}

.storage-info {
    flex: 1;
}

.storage-info h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.storage-info p {
    color: var(--text-muted);
    font-size: 14px;
}

.storage-percent {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.storage-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    background: transparent;
    margin-bottom: 32px;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-content {
    text-align: center;
    padding: 20px;
}

.upload-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border: 2px dashed var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.upload-icon i {
    font-size: 28px;
    color: var(--primary);
}

.upload-text {
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 14px;
}

.upload-progress {
    text-align: center;
    padding: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.2s;
}

.progress-text {
    color: var(--text-muted);
}

/* Files Section */
.files-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s;
}

.file-card:hover {
    border-color: var(--primary);
}

.file-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon i {
    font-size: 18px;
    color: var(--primary);
}

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

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.file-shared {
    width: 24px;
    height: 24px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-shared i {
    font-size: 12px;
    color: var(--primary);
}

.file-actions {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.file-actions .btn {
    flex: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ========== Share Page ========== */
.share-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.share-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.share-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 32px;
    overflow: hidden;
}

.share-card.error {
    padding: 48px 32px;
}

.share-card.error .share-icon {
    background: rgba(239, 68, 68, 0.1);
}

.share-card.error .share-icon i {
    color: var(--error);
}

.share-header {
    padding: 32px;
}

.share-icon {
    width: 80px;
    height: 80px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.share-icon i {
    font-size: 36px;
    color: var(--primary);
}

.share-card h1 {
    font-size: 20px;
    margin-bottom: 12px;
    word-break: break-all;
}

.share-meta {
    color: var(--text-muted);
    font-size: 14px;
}

.share-footer {
    padding: 16px 24px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
}

.download-count {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.share-branding .logo {
    justify-content: center;
    font-size: 16px;
    opacity: 0.7;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-color: var(--success);
}

.toast-error {
    border-color: var(--error);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    font-size: 13px;
}
.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
}
.lang-switch a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 32px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 16px;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 24px;
    }
}
