@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6B21A8; /* L'eventS Purple */
    --primary-hover: #581C87;
    --secondary-color: #9333EA;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --border-color: #E5E7EB;
    --success-color: #059669;
    --danger-color: #DC2626;
    --warning-color: #D97706;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Glassmorphism Styles */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header img {
    height: 60px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 15px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

/* Dashboard & App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

.sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    margin-bottom: 40px;
    text-align: center;
}

.sidebar-logo img {
    height: 40px;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

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

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(107, 33, 168, 0.05);
    color: var(--primary-color);
}

.nav-link i {
    margin-right: 12px;
    font-size: 18px;
}

.main-content {
    overflow-y: auto;
    padding: 32px;
}

/* Components */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

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

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 24px;
    font-weight: 700;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge.draft { background: #E5E7EB; color: #4B5563; }
.badge.sent { background: #DBEAFE; color: #1E40AF; }
.badge.approved { background: #D1FAE5; color: #065F46; }
.badge.cancelled { background: #FEE2E2; color: #991B1B; }
.badge.open { background: #FEF3C7; color: #92400E; }
.badge.completed { background: #D1FAE5; color: #065F46; }

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    padding: 32px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .sidebar {
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-logo {
        margin-bottom: 0;
        margin-right: 16px;
    }
    
    .sidebar-logo h1 {
        font-size: 18px;
    }

    .nav-menu {
        display: flex;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 0;
    }
    
    .nav-item {
        margin-bottom: 0;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .sidebar-footer {
        display: flex;
        padding-top: 0 !important;
        border-top: none !important;
        border-left: 1px solid var(--border-color);
        margin-left: 16px;
        padding-left: 16px;
        gap: 8px;
    }

    .main-content {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header button {
        width: 100% !important;
    }

    .date-filter {
        flex-direction: column;
        width: 100%;
        align-items: stretch !important;
    }
    
    .date-filter input, .date-filter button {
        width: 100% !important;
    }
    .date-filter span { display: none; }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Modals */
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Override inline grid layouts for mobile */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Form groups inside inline flex/grids */
    div[style*="display:flex; gap:8px"], 
    div[style*="display: flex; gap: 8px"] {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    /* Transaction/Order modal row adjustments */
    input[style*="flex:3"], input[style*="flex: 2"], input[style*="flex: 1"] {
        width: 100% !important;
        flex: none !important;
    }
}
