@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #181818;
    --card-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(213, 203, 185, 0.15);
    --primary: #c33a30;
    --primary-hover: #a32e25;
    --accent: #e0a94e;
    --text-main: #d5cbb9;
    --text-muted: #8c8579;
    --danger: #c33a30;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(195, 58, 48, 0.15) 0%, transparent 70%);
    z-index: -1;
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(224, 169, 78, 0.1) 0%, transparent 70%);
    z-index: -1;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Auth Pages */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.auth-box {
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}
.auth-links a:hover {
    color: var(--primary-hover);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-msg {
    background: rgba(34, 197, 94, 0.1);
    color: #86efac;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.quota-container {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: inline-flex;
    flex-direction: column;
    min-width: 250px;
    border: 1px solid var(--glass-border);
}

.quota-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.quota-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--glass-border);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

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

.dropzone-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s;
}

.dropzone:hover .dropzone-icon {
    transform: translateY(-5px);
}

.file-input {
    display: none;
}

.upload-queue {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* URL Upload Section */
.url-upload-container {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.url-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.url-input:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
}

.btn-url {
    background: var(--primary);
    padding: 0.8rem 1.5rem;
    white-space: nowrap;
}
.upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}
.upload-progress {
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s;
}

/* Gallery Grid */
.gallery-header {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.gallery-item-name {
    font-size: 0.875rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-pending { background: rgba(224, 169, 78, 0.2); color: var(--accent); }
.badge-processing { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.badge-ready { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

.status-indicator {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
}

/* Processing Overlay */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

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

.gallery-grid {
    margin-bottom: 3rem;
}

/* Gallery Actions */
.gallery-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 20;
}

.gallery-item:hover .gallery-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.action-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.action-btn.delete:hover {
    background: var(--danger);
}

/* Modal / Lightbox */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 1rem 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    justify-content: center;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    text-decoration: none;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.modal-btn.primary { background: var(--primary); }
.modal-btn.secondary { background: rgba(255,255,255,0.1); }
.modal-btn.success { background: #22c55e; }
.modal-btn.danger { background: var(--danger); }

.modal-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

.close-modal {
    position: absolute;
    top: -60px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.close-modal:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

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

.btn-danger:hover {
    background: #a32a22;
    transform: translateY(-2px);
}

.btn-zip {
    background: #22c55e;
    color: white;
}

.btn-zip:hover {
    background: #16a34a;
    transform: translateY(-2px);
}
