:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Login Styles */
#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box .logo {
    margin-bottom: 2rem;
}

.login-box .logo i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-box .logo h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 44px;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #475569;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

/* Header Styles */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header .logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.header .logo h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Stats Section */
.stats-section {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Upload Section */
.upload-section {
    padding: 0 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.upload-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #f0f9ff;
}

.drop-zone-content i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.drop-zone-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.drop-zone-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.supported-formats {
    margin-top: 1rem;
    color: var(--text-secondary);
}

.upload-progress {
    padding: 1rem;
    background-color: #f8fafc;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

/* Gallery Section */
.gallery-section {
    padding: 0 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.gallery-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.gallery-controls select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

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

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

.gallery-item-info {
    padding: 1rem;
}

.gallery-item-info h4 {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.no-images {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-images i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

#page-info {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    z-index: 1;
}

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

#modal-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
}

.modal-info {
    padding: 1.5rem;
}

.modal-info h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-details {
    margin-bottom: 1.5rem;
}

.modal-details p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
}

.toast {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .modal-content {
        margin: 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-box {
        margin: 1rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .toast {
        min-width: auto;
        margin: 0 1rem;
    }
}
/* Estilos para Pastas */
.folders-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.folders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.folder-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

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

.folder-card i.fa-folder {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 1rem;
}

.folder-card span {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-delete-folder {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-delete-folder:hover {
    background: #fee2e2;
}

.no-folders {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Upload header com seletor de pasta */
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.upload-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.folder-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-select label {
    font-weight: 600;
    color: var(--text-primary);
}

.folder-select select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}

/* Badge de pasta nas imagens */
.folder-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.folder-badge i {
    margin-right: 0.25rem;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.modal-content .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: var(--text-primary);
}

.modal-content .form-group {
    margin-bottom: 1rem;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-content .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.modal-content .form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.modal-content .form-group p {
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-info {
    padding: 1rem 0;
}

.modal-info h3 {
    margin-bottom: 1rem;
}

.modal-details {
    margin: 1rem 0;
}

.modal-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.modal-details strong {
    color: var(--text-primary);
}

/* Botão de renomear */
#rename-btn {
    background-color: var(--secondary-color);
}

#rename-btn:hover {
    background-color: #475569;
}

/* ===== TABS ===== */
.tabs-section {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

.tab-btn i {
    font-size: 1.25rem;
}

/* ===== FILES SECTION ===== */
.files-section {
    margin-top: 2rem;
}

.files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.file-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.file-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-icon i {
    display: block;
}

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

.file-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== TOKEN SECTION ===== */
.token-section {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.token-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.token-section p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
}

.token-display {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.token-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

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

.wget-example {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.wget-example p {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.wget-example code {
    display: block;
    padding: 0.75rem;
    background: #1e293b;
    color: #10b981;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    white-space: nowrap;
}

/* Responsividade para arquivos */
@media (max-width: 768px) {
    .tabs-section {
        flex-direction: column;
    }

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

    .token-display {
        flex-direction: column;
    }

    .token-input {
        font-size: 0.75rem;
    }
}
