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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar-nav {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.sidebar-nav.collapsed {
    width: 72px;
}

.sidebar-nav.collapsed .logo-text,
.sidebar-nav.collapsed .nav-text,
.sidebar-nav.collapsed .nav-badge,
.sidebar-nav.collapsed .profile-info,
.sidebar-nav.collapsed .nav-section-title,
.sidebar-nav.collapsed .submenu,
.sidebar-nav.collapsed .storage-info,
.sidebar-nav.collapsed .upgrade-btn span {
    opacity: 0;
    visibility: hidden;
}

.sidebar-nav.collapsed .submenu-arrow {
    display: none;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 80px;
}

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

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.logo-subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background-color: #f1f5f9;
    color: #334155;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.profile-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-image {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.profile-info {
    flex: 1;
    min-width: 0;
    transition: all 0.3s ease;
}

.profile-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.2;
}

.profile-role {
    font-size: 12px;
    color: #64748b;
}

.profile-menu-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.profile-menu-btn:hover {
    background-color: #f1f5f9;
    color: #334155;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.quick-action-btn {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 12px;
    transition: all 0.3s ease;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    background-color: #f8fafc;
    color: #334155;
}

.nav-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-right: 3px solid #2563eb;
}

.nav-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-text {
    flex: 1;
    transition: all 0.3s ease;
}

.nav-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-badge.new {
    background: #10b981;
    color: white;
}

.nav-link.active .nav-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Submenu */
.has-submenu .nav-link {
    padding-right: 16px;
}

.submenu-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f8fafc;
}

.has-submenu.open .submenu {
    max-height: 200px;
}

.submenu-link {
    display: block;
    padding: 10px 20px 10px 52px;
    text-decoration: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.submenu-link:hover {
    background-color: #f1f5f9;
    color: #334155;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.storage-info {
    margin-bottom: 16px;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.storage-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.storage-percentage {
    font-size: 12px;
    font-weight: 600;
    color: #f59e0b;
}

.storage-bar {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.storage-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
}

.upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav.collapsed ~ .main-content {
    margin-left: 72px;
}

.content-header {
    margin-bottom: 40px;
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.content-header p {
    font-size: 16px;
    color: #64748b;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.content-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.content-card ul {
    list-style: none;
}

.content-card li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 14px;
}

.content-card li:last-child {
    border-bottom: none;
}

.content-card li::before {
    content: '•';
    color: #6366f1;
    margin-right: 12px;
    font-weight: bold;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Tooltip */
.quick-action-btn[data-tooltip] {
    position: relative;
}

.quick-action-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1001;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.quick-action-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #1e293b;
    z-index: 1001;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 72px;
    }
    
    .sidebar-nav {
        width: 72px;
    }
    
    .sidebar-nav .logo-text,
    .sidebar-nav .nav-text,
    .sidebar-nav .nav-badge,
    .sidebar-nav .profile-info,
    .sidebar-nav .nav-section-title,
    .sidebar-nav .submenu,
    .sidebar-nav .storage-info,
    .sidebar-nav .upgrade-btn span {
        opacity: 0;
        visibility: hidden;
    }
    
    .sidebar-nav .submenu-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar-nav {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar-nav.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-nav.mobile-open .logo-text,
    .sidebar-nav.mobile-open .nav-text,
    .sidebar-nav.mobile-open .nav-badge,
    .sidebar-nav.mobile-open .profile-info,
    .sidebar-nav.mobile-open .nav-section-title,
    .sidebar-nav.mobile-open .storage-info,
    .sidebar-nav.mobile-open .upgrade-btn span {
        opacity: 1;
        visibility: visible;
    }
    
    .sidebar-nav.mobile-open .submenu-arrow {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .content-header h1 {
        font-size: 24px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .content-card {
        padding: 20px;
    }
}

/* Scrollbar Styling */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}