/* Style Sheet for Cloud Gallery - Premium Glassmorphism Theme */
:root {
    --bg-color: #080710;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    --primary-grad: linear-gradient(135deg, #7f00ff, #ff007f);
    --accent-grad: linear-gradient(135deg, #00d2ff, #00a8ff);
    --neon-blue: #00d2ff;
    --neon-purple: #8a2be2;
    --neon-pink: #ff007f;
    --text-main: #f5f5fa;
    --text-muted: #8e8d9a;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 7, 16, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.6);
}

/* Glowing Orbs & Floating stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: 0.15;
    animation: starsMove 120s linear infinite;
}

@keyframes starsMove {
    from { background-position: 0 0, 40px 60px, 130px 270px; }
    to { background-position: 550px 1100px, 390px 760px, 630px 1070px; }
}

.glowing-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -2;
    opacity: 0.22;
    pointer-events: none;
    animation: orbPulse 12s ease-in-out infinite alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--neon-purple), transparent 70%);
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--neon-blue), transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -6s;
}

@keyframes orbPulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.18; }
    100% { transform: scale(1.15) translate(30px, 50px); opacity: 0.28; }
}

/* Glassmorphism utility card */
.card-glass {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow-main);
    transition: var(--transition);
}

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

/* Gradients and Text */
.icon-gradient {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.link-gradient {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.link-gradient:hover {
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    color: #fff;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

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

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Alert Boxes */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-danger {
    background: rgba(255, 75, 75, 0.15);
    border: 1px solid rgba(255, 75, 75, 0.3);
    color: #ff6b6b;
}

.alert-success {
    background: rgba(75, 255, 125, 0.15);
    border: 1px solid rgba(75, 255, 125, 0.3);
    color: #51cf66;
}

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

/* --- AUTHENTICATION PAGES --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    margin: 40px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.logo i {
    font-size: 2.2rem;
}

.logo h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo h2 span {
    font-weight: 300;
    color: var(--neon-blue);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 300;
}

/* Form Styles */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-group label i {
    margin-right: 5px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- DASHBOARD PAGE --- */
.dashboard-page {
    padding: 24px;
}

.dashboard-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo i {
    font-size: 1.8rem;
}

.header-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

.header-logo h1 span {
    font-weight: 300;
    color: var(--neon-blue);
}

.user-control {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.user-info span {
    font-size: 0.95rem;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
    gap: 20px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.icon-blue {
    background: rgba(0, 210, 255, 0.15);
    color: var(--neon-blue);
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.icon-purple {
    background: rgba(138, 43, 226, 0.15);
    color: var(--neon-purple);
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.icon-green {
    background: rgba(81, 207, 102, 0.15);
    color: #51cf66;
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.stat-info h3 {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 1.4rem;
    font-weight: 700;
}

/* Layout Main Content */
.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

/* Left Panel: Upload */
.upload-panel {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-panel h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.upload-panel .subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.01);
}

.dropzone.dragover {
    border-color: var(--neon-blue);
    background: rgba(0, 210, 255, 0.05);
    transform: scale(1.02);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.dropzone.dragover .drop-icon {
    color: var(--neon-blue);
    transform: translateY(-5px);
}

.dropzone-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.dropzone-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dropzone-content span {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Progress bar */
.upload-progress-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue));
    border-radius: 3px;
    transition: width 0.1s ease;
}

/* Right Panel: Gallery */
.gallery-panel {
    padding: 30px;
    min-height: 500px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
}

.gallery-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--neon-purple);
    background: rgba(255, 255, 255, 0.06);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.gallery-card {
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gallery-card:hover .card-image img {
    transform: scale(1.08);
}

/* Overlay controls */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 7, 16, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-action:hover {
    transform: scale(1.15);
}

.btn-view {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-view:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

.btn-copy {
    background: rgba(0, 210, 255, 0.2);
    border: 1px solid rgba(0, 210, 255, 0.4);
    color: var(--neon-blue);
}
.btn-copy:hover {
    background: var(--neon-blue);
    color: #fff;
}

.btn-delete {
    background: rgba(255, 75, 75, 0.2);
    border: 1px solid rgba(255, 75, 75, 0.4);
    color: #ff6b6b;
}
.btn-delete:hover {
    background: #ff4b4b;
    color: #fff;
}

/* Card details */
.card-details {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-details h4 {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Lightbox Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 7, 16, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content-container {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-content {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.4);
    object-fit: contain;
}

#modal-caption {
    margin-top: 15px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--text-muted);
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1100;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--neon-blue);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-main);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), fadeOut 0.3s ease 3.7s forwards;
    width: 320px;
}

.toast.toast-success {
    border-left-color: #51cf66;
}

.toast.toast-error {
    border-left-color: #ff6b6b;
}

.toast i {
    font-size: 1.1rem;
}

.toast.toast-success i { color: #51cf66; }
.toast.toast-error i { color: #ff6b6b; }
.toast.toast-info i { color: var(--neon-blue); }

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

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

/* --- RESPONSIVENESS --- */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .upload-panel {
        position: static;
    }
}

@media (max-width: 600px) {
    .dashboard-page {
        padding: 12px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: center;
        text-align: center;
    }
    
    .user-control {
        width: 100%;
        justify-content: space-between;
    }

    .auth-container {
        padding: 24px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
    
    .toast {
        width: auto;
    }
}
