/* 
 * YUSEE CMS - Premium Design System v2.5
 * Dynamic Theme System (Dark/Light)
 */

:root {
    /* Base Colors - Dark Mode (Default) */
    --bg-main: #020617; /* Deepest Indigo */
    --bg-page: radial-gradient(circle at top right, #1e1b4b, #020617);
    --text-primary: #f8fafc;
    --text-slate: #94a3b8;
    --accent: #818cf8; /* Indigo 400 */
    --accent-hover: #a5b4fc;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-bg-hover: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    --success: #10b981;
    --danger: #ef4444;
}

[data-theme="light"] {
    /* Base Colors - Light Mode */
    --bg-main: #f8fafc; /* Slate 50 */
    --bg-page: radial-gradient(circle at top right, #e0e7ff, #f8fafc);
    --text-primary: #0f172a; /* Slate 900 */
    --text-slate: #475569; /* Slate 600 */
    --accent: #4f46e5; /* Indigo 600 */
    --accent-hover: #4338ca;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-hover: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(15, 23, 42, 0.08);
    --glass-shadow: rgba(15, 23, 42, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-main);
    background-image: var(--bg-page);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.4s ease;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Auth Page */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.auth-header p {
    color: var(--text-slate);
    font-size: 0.9375rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-slate);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

[data-theme="light"] .form-control {
    background: rgba(0, 0, 0, 0.03);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

/* Dashboard Layout */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem 0 3rem;
    position: sticky;
    top: 1rem;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .header-left h1 {
    background: linear-gradient(to right, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    gap: 0.75rem;
}

/* Grid */
.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.plugin-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.plugin-card:hover {
    transform: translateY(-8px);
    background: var(--glass-bg-hover);
    border-color: var(--accent);
}

.plugin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.plugin-icon {
    width: 48px;
    height: 48px;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.version-badge {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--glass-border);
}

.plugin-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.plugin-info p {
    font-size: 0.9375rem;
    color: var(--text-slate);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.plugin-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.upload-inline {
    flex: 1;
}

.btn-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-file:hover {
    background: var(--accent-hover);
}

.btn-file input[type="file"] {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    gap: 0.6rem;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

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

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-slate);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

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

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hidden { display: none !important; }

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        align-items: stretch;
    }
    
    .header-right {
        justify-content: center;
    }
    
    .plugin-grid {
        grid-template-columns: 1fr;
    }
}
