/* ==========================================
   MangaStudio - Main CSS
   Reset, Variables & Global Utilities
   ========================================== */

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

/* CSS Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fbfbfd;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #a1a1a6;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --border: #d2d2d7;
    --border-light: #e8e8ed;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Body */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Main Container */
.main {
    padding-top: 52px;
    min-height: 100vh;
}

/* Page Sections */
.page {
    display: none;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.page.active {
    display: block;
}

/* Global Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 52px;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 999;
    transition: width 0.3s ease;
}

/* Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateX(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: var(--transition);
}

/* Loading Shimmer */
.loading-shimmer {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, #e8e8ed 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Spin Animation */
.spin {
    animation: spin 1s linear infinite;
}

/* Responsive - Base */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main {
        padding-top: 52px;
    }
}

/* ==========================================
   Toast Notifications
   ========================================== */

.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    width: auto;
}

.toast-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification svg {
    flex-shrink: 0;
}

.toast-notification span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Toast Types */
.toast-success {
    border-color: #34c759;
}

.toast-success svg {
    color: #34c759;
}

.toast-error {
    border-color: #ff3b30;
}

.toast-error svg {
    color: #ff3b30;
}

.toast-info {
    border-color: var(--accent);
}

.toast-info svg {
    color: var(--accent);
}

/* ==========================================
   Loading States
   ========================================== */

.loading-projects {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    font-size: 15px;
    color: var(--text-secondary);
}

.error-message {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    font-size: 15px;
    color: #ff3b30;
    text-align: center;
}

/* ==========================================
   Responsive Toast
   ========================================== */

@media (max-width: 768px) {
    .toast-notification {
        bottom: 16px;
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }

    .toast-notification span {
        font-size: 13px;
    }
}
