﻿/* orjisync Core Styles - Consolidated CSS */

/* ===== CSS Variables ===== */
:root {
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
}

/* ===== Glass Utilities ===== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.glass-input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.glass-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: #fff;
}

.glass-btn:active {
    transform: translateY(0);
}

/* ===== Toast Notification System ===== */
/* Toast container positioned bottom-right for better UX */
#toastContainer {
    position: fixed;
    top: auto;
    left: auto;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
}

/* Mobile adjustment: center horizontally but keep at bottom */
@media (max-width: 480px) {
    #toastContainer {
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
        align-items: center;
    }
    .toast {
        width: 100%;
        max-width: none;
    }
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
    animation: toast-slide-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: #10b981; }
.toast.error .toast-icon { color: #ef4444; }
.toast.info .toast-icon { color: #3b82f6; }
.toast.warning .toast-icon { color: #f59e0b; }

.toast-message {
    flex: 1;
    color: #334155;
    line-height: 1.5;
}

.toast-close {
    margin-left: 1rem;
    padding: 0.25rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    transition: all 220ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.375rem;
}

.toast-close:hover {
    color: #475569;
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateY(1rem) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.hide {
    animation: toast-slide-out 300ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toast-slide-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(1rem) scale(0.9); }
}

/* ===== Modern Toast Notifications (with title support) ===== */
.toast-notification {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
    animation: toast-slide-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
    min-width: 280px;
    max-width: 400px;
}

.toast-notification.success {
    border-left: 4px solid #10b981;
}

.toast-notification.error {
    border-left: 4px solid #ef4444;
}

.toast-notification.info {
    border-left: 4px solid #3b82f6;
}

.toast-notification.warning {
    border-left: 4px solid #f59e0b;
}

.toast-notification .toast-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    padding-top: 0.125rem;
}

.toast-notification.success .toast-icon { color: #10b981; }
.toast-notification.error .toast-icon { color: #ef4444; }
.toast-notification.info .toast-icon { color: #3b82f6; }
.toast-notification.warning .toast-icon { color: #f59e0b; }

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.toast-title {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.toast-content .toast-message {
    color: #475569;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-notification .toast-close {
    margin-left: 0.5rem;
    padding: 0.375rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    transition: all 220ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.375rem;
    align-self: flex-start;
}

.toast-notification .toast-close:hover {
    color: #475569;
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
}

.toast-notification.hide {
    animation: toast-slide-out 300ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

@media (max-width: 480px) {
    .toast-notification {
        min-width: 260px;
        max-width: calc(100vw - 40px);
    }
}

/* ===== Upload Components ===== */
.upload-cloud-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.upload-cloud-icon i {
    font-size: 1.25rem;
    color: rgba(147, 197, 253, 0.9);
}

#drop-area.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Compact Upload Progress ===== */
.compact-upload-progress {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.compact-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(148, 163, 184, 0.8);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.compact-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.compact-action-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.compact-progress-bar-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.compact-progress-bar-container-inner {
    height: 6px;
}

.compact-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ===== Admin Panel Styles ===== */
.admin-mode {
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0, transparent 50%), 
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0, transparent 50%);
    background-attachment: fixed;
}

.centered-content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ===== Glass Modal ===== */
.glass-modal {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 14, 31, 0.95) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.glass-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 1.5rem;
}

.glass-modal .modal-title {
    color: rgba(241, 245, 249, 0.95);
    font-weight: 600;
}

.glass-modal .modal-body {
    padding: 1.5rem;
    color: rgba(203, 213, 225, 0.9);
}

.glass-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.5rem;
}

/* ===== Custom Modal Overlay ===== */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    padding: 1rem;
}

.custom-modal-card {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(8, 14, 31, 0.98) 100%);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-modal-close {
    background: transparent;
    border: none;
    color: rgba(148, 163, 184, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.custom-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.custom-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== Table Styles ===== */
.table {
    color: rgba(226, 232, 240, 0.9);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: rgba(148, 163, 184, 0.08);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.03);
}

/* ===== Custom Scrollbar ===== */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    #toastContainer {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .toast {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}
