/* ========================================
   VIDIUM CLOUD - Estilos Modernos Premium
   ======================================== */

:root {
    /* Cores Primárias */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-lighter: #e0e7ff;
    
    /* Cores Secundárias */
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;
    
    /* Estados */
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Escala de Cinza */
    --dark: #1f2937;
    --dark-light: #374151;
    --light: #f9fafb;
    --light-dark: #f3f4f6;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --gray-lighter: #f0f1f3;
    
    /* Espaçamento */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    
    /* Sombras */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transições */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    max-width: 480px;
    width: 100%;
    animation: slideUp 0.5s ease-out;
}

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

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fafbff;
}

.form-group input::placeholder {
    color: var(--gray-light);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray);
    font-weight: 400;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    user-select: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 100%;
    box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray);
    color: white;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-icon {
    padding: 8px 16px;
    font-size: 13px;
    margin: 0 4px;
}

.auth-toggle {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--gray-light);
    font-size: 14px;
    color: var(--gray);
}

.auth-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: var(--transition-fast);
}

.auth-toggle a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.warning-box {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

.warning-box strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.info-box {
    background: var(--light-dark);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid var(--primary);
}

.info-box h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--dark);
    font-weight: 600;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--gray);
}

.dashboard {
    min-height: 100vh;
    background: var(--light);
}

.header {
    background: white;
    padding: 20px 40px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-small {
    font-size: 32px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--light-dark);
    border-radius: var(--border-radius-sm);
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-email {
    font-size: 12px;
    color: var(--gray);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 40px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card-highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.stat-icon {
    font-size: 48px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.upload-area {
    margin: 0 40px 40px;
    background: white;
    border: 3px dashed var(--gray-light);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-lighter);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

.upload-area h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 600;
}

.upload-area p {
    color: var(--gray);
    font-size: 14px;
}

.progress-container {
    margin: 0 40px 20px;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: none;
}

.progress-container.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.progress-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    font-size: 14px;
    color: var(--gray);
    text-align: center;
}

.files-section {
    padding: 0 40px 40px;
}

.files-section h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.loading.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 600;
}

.empty-state p {
    color: var(--gray);
}

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

.file-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.file-card:hover::before {
    transform: scaleX(1);
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.file-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.file-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 12px;
}

.file-badge {
    display: inline-block;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-download {
    background: var(--success);
    color: white;
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-download:hover {
    background: #059669;
}

.btn-delete {
    background: var(--danger);
    color: white;
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-delete:hover {
    background: #dc2626;
}

#alertContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(400px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert.show {
    opacity: 1;
    transform: translateX(0);
}

.alert-success {
    background: var(--success);
    color: white;
}

.alert-error {
    background: var(--danger);
    color: white;
}

.alert-info {
    background: var(--info);
    color: white;
}

.footer {
    background: white;
    padding: 30px 40px;
    margin-top: 40px;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.footer-content {
    font-size: 13px;
    color: var(--gray);
}

.footer-content p {
    margin: 8px 0;
}

@media (max-width: 768px) {
    .header {
        padding: 20px;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }

    .stats-container {
        padding: 20px;
        grid-template-columns: 1fr;
    }

    .upload-area {
        margin: 0 20px 20px;
        padding: 40px 20px;
    }

    .files-section {
        padding: 0 20px 20px;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .progress-container {
        margin: 0 20px 20px;
    }

    .footer {
        padding: 20px;
    }

    #alertContainer {
        left: 20px;
        right: 20px;
        max-width: none;
    }

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

@media (max-width: 480px) {
    .auth-box {
        padding: 20px;
    }

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

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

    .files-grid {
        grid-template-columns: 1fr;
    }

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

    .upload-icon {
        font-size: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
