/* public/css/styles.css - MAIN (imports all modules) */

/* ============ IMPORTS ============ */
@import url('nav.css');
@import url('header.css');
@import url('components.css');

/* ============ ROOT VARIABLES ============ */
:root {
    --primary: #0f172a;
    --secondary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --text: #1e293b;
    --sidebar-text: #94a3b8;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
}

/* ============ BASE STYLES ============ */
* {
    box-sizing: border-box;
}

html {
    background-color: var(--bg);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Main Content */
main {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
    font-size: 0.85rem;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
    color: #065f46;
}

.toast-error {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
    background: #e0f2fe;
    color: #0369a1;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

/* ============ UPGRADE MODAL STYLES ============ */
.upgrade-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.upgrade-modal.show {
    display: flex;
}

.upgrade-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.upgrade-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 1rem 1.25rem;
    text-align: center;
    position: relative;
}

.upgrade-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.upgrade-modal-header h3 i {
    width: 18px;
    height: 18px;
}

.upgrade-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.upgrade-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.upgrade-modal-body {
    padding: 1rem 1.25rem;
}

.custom-upgrade-message {
    background: #fee2e2;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.upgrade-features {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.upgrade-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.7rem;
}

.upgrade-feature-item:last-child {
    border-bottom: none;
}

.upgrade-feature-item i {
    width: 14px;
    height: 14px;
    color: #10b981;
}

.upgrade-plans {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.upgrade-plan-card {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.2s;
}

.upgrade-plan-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.upgrade-plan-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.upgrade-plan-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--secondary);
}

.upgrade-plan-price small {
    font-size: 0.55rem;
    font-weight: normal;
}

.upgrade-plan-desc {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.upgrade-plan-feature {
    font-size: 0.55rem;
    color: #475569;
    text-align: left;
    padding: 0.2rem 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.upgrade-plan-feature::before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
}

.upgrade-modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.btn-upgrade {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* ============ RESPONSIVE STYLES ============ */

/* Tablet and Mobile */
@media (max-width: 768px) {
    /* Sidebar */
    aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: none;
        padding: 1.5rem;
        transition: transform 0.25s ease-out;
    }
    
    aside.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    }
    
    .sidebar-close-btn {
        display: flex !important;
    }
    
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Dropdown on mobile */
    .dropdown-menu {
        position: static;
        background: rgba(255,255,255,0.05);
        margin-left: 2rem;
        box-shadow: none;
    }
    
    .dropdown-menu a {
        padding-left: 2rem;
    }
    
    /* Menu toggle */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Container */
    .container {
        padding: 1rem;
    }
    
    /* Header */
    header {
        padding: 0.6rem 1rem;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }
    
    .header-icon {
        width: 32px;
        height: 32px;
    }
    
    .header-icon i {
        width: 16px;
        height: 16px;
    }
    
    .header-title {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .header-title h4 {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    
    .header-title p {
        font-size: 0.6rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    
    .header-right {
        gap: 10px;
        flex-shrink: 0;
    }
    
    .header-badge {
        padding: 4px 10px;
    }
    
    .header-badge span {
        font-size: 0.65rem;
    }
    
    .user-info {
        max-width: 120px;
        overflow: hidden;
    }
    
    .user-name {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .user-role {
        font-size: 0.6rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-avatar i {
        width: 16px;
        height: 16px;
    }
    
    /* Tooltip on mobile */
    .header-title h4:active::after {
        content: attr(title);
        position: absolute;
        top: 100%;
        left: 0;
        background: #1e293b;
        color: white;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 0.7rem;
        white-space: nowrap;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        margin-top: 5px;
    }
    
    /* Upgrade modal on mobile */
    .upgrade-plans {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upgrade-modal-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .upgrade-modal-buttons .btn,
    .upgrade-modal-buttons .btn-upgrade {
        width: 100%;
        justify-content: center;
    }
}

/* Desktop tooltip */
@media (min-width: 769px) {
    .header-title h4:hover::after {
        content: attr(title);
        position: absolute;
        top: 100%;
        left: 0;
        background: #1e293b;
        color: white;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 0.75rem;
        white-space: nowrap;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        margin-top: 5px;
    }
    
    /* Desktop sidebar collapsed */
    aside.collapsed {
        width: var(--sidebar-collapsed-width);
    }
    
    aside.collapsed .logo-text,
    aside.collapsed .nav-links a span,
    aside.collapsed #logoutBtn span {
        opacity: 0;
        width: 0;
        display: none;
    }
    
    .sidebar-close-btn {
        display: none !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    /* Header */
    header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-left {
        gap: 6px;
    }
    
    .header-title h4 {
        font-size: 0.75rem;
        max-width: 110px;
    }
    
    .header-title p {
        font-size: 0.55rem;
        max-width: 110px;
    }
    
    .header-badge {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .header-right {
        gap: 6px;
    }
    
    /* Upgrade modal */
    .upgrade-modal-content {
        max-width: 380px;
        max-height: 90vh;
    }
    
    .upgrade-feature-item {
        font-size: 0.65rem;
    }
    
    .upgrade-plan-name {
        font-size: 0.7rem;
    }
    
    .upgrade-plan-price {
        font-size: 0.9rem;
    }
}