/* 
   Premium Glassmorphism Theme - Contracting App 
*/

:root {
    /* Color Palette - Lam Almasakin Identity */
    --primary-color: #4a5c76; /* Slate Blue from Logo text */
    --primary-hover: #354760;
    --secondary-color: #cdad92; /* Tan/Gold from Logo icon */
    --success-color: #10b981; /* Emerald */
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Backgrounds - Lam Almasakin Deep Dark */
    --bg-main: #111820; /* Rich dark navy inspired by logo blue */
    --bg-glass: rgba(20, 30, 48, 0.75);
    --bg-glass-hover: rgba(20, 30, 48, 0.92);
    --bg-input: rgba(10, 18, 30, 0.65);
    --gold: #cdad92;
    --gold-light: #e8d5bc;
    --gold-dark: #a07850;
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Borders & Shadows */
    --border-glass: rgba(255, 255, 255, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Light Theme Variables */
body.light-theme {
    --bg-main: #f0f4f8; /* Light cool gray */
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(255, 255, 255, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-glass: rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    
    /* Background inspired by Lam Almasakin logo */
    background-image:
        /* Gold arches top-right - like the logo icon */ 
        radial-gradient(ellipse at 85% -5%, rgba(205, 173, 146, 0.25) 0%, transparent 40%),
        /* Deep blue glow bottom-left - like the logo text color */
        radial-gradient(ellipse at -5% 90%, rgba(74, 92, 118, 0.35) 0%, transparent 45%),
        /* Subtle gold center warmth */
        radial-gradient(ellipse at 50% 50%, rgba(160, 120, 80, 0.06) 0%, transparent 60%),
        /* Top left cool shadow */
        radial-gradient(ellipse at 10% 10%, rgba(30, 50, 80, 0.5) 0%, transparent 35%);
    background-attachment: fixed;
}

/* Decorative SVG-like geometric overlay inspired by logo arabesque pattern */
body::before {
    content: '';
    position: fixed;
    top: 0; right: 0;
    width: 420px; height: 420px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' opacity='0.07'%3E%3Cpath d='M100 10 C60 10 20 50 20 100 C20 150 60 190 100 190 C140 190 180 150 180 100 C180 50 140 10 100 10Z' fill='none' stroke='%23cdad92' stroke-width='2'/%3E%3Cpath d='M100 30 L100 170 M30 100 L170 100 M44 44 L156 156 M156 44 L44 156' fill='none' stroke='%23cdad92' stroke-width='1'/%3E%3Cpath d='M100 10 C100 10 130 50 130 100 C130 150 100 190 100 190 C100 190 70 150 70 100 C70 50 100 10 100 10Z' fill='none' stroke='%23cdad92' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -50px; left: -50px;
    width: 350px; height: 350px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' opacity='0.05'%3E%3Cpath d='M100 10 C60 10 20 50 20 100 C20 150 60 190 100 190 C140 190 180 150 180 100 C180 50 140 10 100 10Z' fill='none' stroke='%234a5c76' stroke-width='2'/%3E%3Cpath d='M100 30 L100 170 M30 100 L170 100 M44 44 L156 156 M156 44 L44 156' fill='none' stroke='%234a5c76' stroke-width='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    border-radius: 16px;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    padding: 1rem;
    gap: 1.5rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.logo-icon {
    color: var(--secondary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.user-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
}

.role-switcher {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.role-switcher select {
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

/* Navigation */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: right;
}

.nav-item:hover, .nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.nav-item.active {
    border-right: 4px solid var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-input);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    width: 300px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    width: 100%;
    outline: none;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

.icon-btn {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

.notification-dot {
    position: absolute;
    top: 0px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 50%;
}

.views-container {
    flex: 1;
    animation: fadeIn var(--transition-normal);
}

/* Typography & General Components */
h1.page-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Grid Layouts for Data */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
}

/* Cards & Lists */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.task-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform var(--transition-fast);
}

.task-card:hover {
    transform: translateY(-5px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-weight: bold;
}

.status-pending { background: rgba(245, 158, 11, 0.2); color: var(--warning-color); }
.status-approved { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: var(--danger-color); }
.status-progress { background: rgba(59, 130, 246, 0.2); color: var(--primary-color); }

.task-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}
.btn-success:hover {
    background-color: var(--success-color);
    color: white;
}

.btn-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}
.btn-warning:hover {
    background-color: var(--warning-color);
    color: white;
}

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

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    transform: translateY(0);
    transition: transform var(--transition-normal);
}

.modal-overlay.hidden .modal-container {
    transform: translateY(-50px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

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

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

.animate-fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

/* Login Screen Styles */
.login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #0d1520;
    background-image:
        /* Top right golden glow - logo gold color */
        radial-gradient(ellipse at 90% 0%, rgba(205, 173, 146, 0.4) 0%, transparent 45%),
        /* Bottom left slate blue - logo text color */
        radial-gradient(ellipse at 0% 100%, rgba(74, 92, 118, 0.5) 0%, transparent 50%),
        /* Center deep atmosphere */
        radial-gradient(ellipse at 50% 50%, rgba(20, 35, 60, 0.8) 0%, transparent 70%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-normal);
    overflow: hidden;
}

/* Geometric pattern overlay on login */
.login-overlay::before {
    content: '';
    position: absolute;
    top: -100px; right: -100px;
    width: 500px; height: 500px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' opacity='0.12'%3E%3Cpath d='M150 20 C90 20 30 80 30 150 C30 220 90 280 150 280 C210 280 270 220 270 150 C270 80 210 20 150 20Z' fill='none' stroke='%23cdad92' stroke-width='2'/%3E%3Cpath d='M150 20 C150 20 200 80 200 150 C200 220 150 280 150 280 C150 280 100 220 100 150 C100 80 150 20 150 20Z' fill='none' stroke='%23cdad92' stroke-width='1.5'/%3E%3Cpath d='M20 150 L280 150 M150 20 L150 280 M55 55 L245 245 M245 55 L55 245' fill='none' stroke='%23cdad92' stroke-width='0.8'/%3E%3Ccircle cx='150' cy='150' r='60' fill='none' stroke='%23cdad92' stroke-width='1'/%3E%3Ccircle cx='150' cy='150' r='120' fill='none' stroke='%23cdad92' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.login-overlay::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -100px;
    width: 400px; height: 400px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' opacity='0.1'%3E%3Cpath d='M150 20 C90 20 30 80 30 150 C30 220 90 280 150 280 C210 280 270 220 270 150 C270 80 210 20 150 20Z' fill='none' stroke='%234a5c76' stroke-width='2'/%3E%3Ccircle cx='150' cy='150' r='80' fill='none' stroke='%234a5c76' stroke-width='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}

.login-box {
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(205, 173, 146, 0.3);
    border-left: 1px solid rgba(205, 173, 146, 0.1);
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}
