@tailwind base;
@tailwind components;
@tailwind utilities;


/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI'
}

:root {
    --primary: #F9FAFB;
    --secondary: #E6F0FF;
    --teritary: #303165;
    --teritary-dark: #151131;
    --primary-hover: #818CF8;
    --white: #111827;
    --half-white: #111827E6;

    --button: #6366F1;
    --button-hover: #3F43FC;
    --button-disable: #6365f1af;
    --input-bg: #d0d1d3;
    
    --text-color: #242b35;
    --text-secondary:#507491;
    --text-muted: #7A7A7A;
    
    --shadow-color: rgba(0, 0, 0, 0.3);
    --border-color: #cacdd1;
    
    --error-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 50px;
    --transition: all 0.2s ease;
}

/* Dark Theme Variables */
html[data-theme="dark"] {
    --primary: #111827;
    --secondary: #1F2937;
    --teritary: #303165;
    --teritary-dark: #151131;
    --primary-hover: #818CF8;
    --white: #ffffff;
    --half-white: #FFFFFFE6;

    --button: #6366F1;
    --button-hover: #3F43FC;
    --button-disable: #6366F14d;
    --input-bg: #384455;
    
    --text-color: #F9FAFB;
    --text-secondary:#809FB8;
    --text-muted: #7A7A7A;
    
    --shadow-color: rgba(0, 0, 0, 0.3);
    --border-color: #374151;
    
    --error-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 50px;
    --transition: all 0.2s ease;
}

html[data-theme="dark"] .theme-toggle .light-icon {
    opacity: 1;
}

html[data-theme="dark"] .theme-toggle .dark-icon {
    opacity: 0;
}

body {
    background-color: var(--primary);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 12px;
}
@media screen and (min-width: 1024px) { 
    body {
        font-size: 15px;
    }
}

/* Chrome, Edge and Safari */
*::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}
*::-webkit-scrollbar-track {
  border-radius: 3px;
  background-color: var(--border-color);
  &:hover {
    background-color: #fff;
  }
  &:active {
    background-color: #fff;
  }
}

*::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #E7E7E7;
  &:hover {
    background-color: #afaeae;
  }
  &:active {
    background-color: #afaeae; 
  }
}




/* button -start  */
.btn {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;

    &.btn-primary {
        background-color: var(--button);
        color: white;
        &:hover {
            background-color: var(--button-hover);    
        }
        &[disabled], &.disabled {
            background-color: var(--button-disable);
            cursor: not-allowed;
        }
    }
    &.btn-outline {
        color: inherit;
        background-color: transparent;
        border: 1px solid var(--border-color);
        &:hover {
            color: var(--button);
            border-color: var(--button);
        }
    }

    &.btn-light {
        background-color: var(--half-white);
        color: var(--primary);
        &:hover {
            background-color: var(--white);
        }
    }

    &.btn-teritary {
        background-color: var(--secondary);
        color: var(--white);
        &:hover {
            color: var(--teritary-dark);
            border-color: var(--teritary-dark);
        }
        &[disabled], &.disabled {
            background-color: var(--secondary);
            color: #4B4C4E;
            cursor: not-allowed;
        }
    }

    &.btn-link {
        background-color: transparent;
        color: var(--button);
        text-decoration: underline;
        padding: 0 1rem;
        &:hover {
            text-decoration: none;
        }
    }

    &.btn-clear {
        background-color: transparent;
        color: var(--white);
        text-decoration: underline;
        padding: 0 1rem;
        &:hover {
            text-decoration: none;
        }
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    
    .modal-content {
        background-color: var(--primary);
        border-radius: 12px;
        box-shadow: 0 10px 30px var(--shadow-color);
        width: 90%;
        max-width: 500px;
    
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            /* border-bottom: 1px solid var(--border-color); */
            
            h3 {
                margin: 0;
                font-size: 1.25rem;
            }
            
            .modal-close {
                background: none;
                border: none;
                font-size: 1.75rem;
                cursor: pointer;
                color: var(--text-secondary);
            }
        }

        .modal-body {
            padding: 1rem 1.5rem;
            p {
                margin-top: 0;
                margin-bottom: 1rem;
                color: var(--text-secondary);
            }
            .sample-options {
                display: grid;
                grid-template-columns: 1fr;
                gap: 1rem;
                
                .sample-option-btn {
                    width: 100%;
                    text-align: left;
                    padding: 1rem;
                    font-size: 1rem;
                }
            }
            
        }
    }
}

html[data-theme="dark"] {
    *::-webkit-scrollbar-track {
        background-color: #111827;
        &:hover {
            background-color: #7A7A7A;
        }
        &:active {
            background-color: #7A7A7A;
        }
        }

        *::-webkit-scrollbar-thumb {
        background-color: #4B4C4E;
        &:hover {
            background-color: #303165;
        }
        &:active {
            background-color: #809FB8; 
        }
        }
    .btn {
        &.btn-teritary {
            background-color: var(--teritary);
            color: var(--white);
            &:hover {
                background-color: var(--teritary-dark);
                border-color: var(--white);
            }
            &[disabled], &.disabled {
                background-color: var(--secondary);
                color: #4B4C4E;
            }
        }
    }

    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        backdrop-filter: blur(5px);
        
        .modal-content {
            background-color: var(--secondary);
            border-radius: 12px;
            box-shadow: 0 10px 30px var(--shadow-color);
            width: 90%;
            max-width: 500px;
        
            .modal-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 1rem 1.5rem;
                /* border-bottom: 1px solid var(--border-color); */
                
                h3 {
                    margin: 0;
                    font-size: 1.25rem;
                }
                
                .modal-close {
                    background: none;
                    border: none;
                    font-size: 1.75rem;
                    cursor: pointer;
                    color: var(--text-secondary);
                }
            }

            .modal-body {
                padding: 1.5rem;
                p {
                    margin-top: 0;
                    margin-bottom: 1.5rem;
                    color: var(--text-secondary);
                }
                .sample-options {
                    display: grid;
                    grid-template-columns: 1fr;
                    gap: 1rem;
                    
                    .sample-option-btn {
                        width: 100%;
                        text-align: left;
                        padding: 1rem;
                        font-size: 1rem;
                    }
                }
                
            }
        }
    }
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Side Navigation */
.side-nav {
    display: none;
    width: var(--sidebar-width);
    background-color: var(--secondary);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease, background-color 0.3s ease;
    z-index: 100;
}

/* Collapsed sidebar styles */
.side-nav.collapsed {
    width: var(--sidebar-collapsed-width);
}

.side-nav.collapsed .site-title,
.side-nav.collapsed .nav-item span,
.side-nav.collapsed .logo-icon {
    display: none;
}

.side-nav.collapsed .nav-item a {
    justify-content: center;
    padding: 0.75rem;
}

.side-nav.collapsed .nav-item a i {
    margin-right: 0;
}

/* html[data-theme="dark"] .side-nav {
    background-color: #111827;
    border-right: 1px solid #374151;
} */

.logo {
    display: flex;
    align-items: center;
    padding: 10.5px;
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
    transition: border-color 0.3s ease;
}

/* html[data-theme="dark"] .logo {
    border-bottom: 1px solid transparent;
} */

.logo-icon {
    width: 26px;
    height: 24px;
    margin-right: 7px;
}

.site-title {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-item a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-item a:hover, 
.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* html[data-theme="dark"] .nav-item a {
    color: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .nav-item a:hover,
html[data-theme="dark"] .nav-item.active a {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
} */

/* Sidebar Footer with Logout Button */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #1a232e;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* html[data-theme="dark"] .sidebar-footer {
    background-color: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
} */

.logout-button {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: rgba(239, 68, 68, 0.2);
}

.logout-button:hover {
    background-color: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.logout-button i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Toggle button for sidebar */
.nav-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.nav-toggle:hover {
    color: var(--button);
}

.sidebar-collapsed .nav-toggle {
    transform: rotate(180deg);
}

/* Main Content */
.main-content {
    flex: 1;
    /* margin-left: var(--sidebar-width); */
    transition: margin-left 0.3s ease, padding-top 0.3s ease;
    background-color: #F6F7F8;
    min-height: 100vh;
    padding-top: 60px;
    &.home {
        background: url('../assets/home_bg_light.png') no-repeat right bottom;
        background-size: 40%;
    }
}
html[data-theme="dark"] {
    .main-content {
        background-color: var(--primary);
        &.home {
            background: url('../assets/home_bg.png') no-repeat right bottom;
            background-size: 40%;
        }
    }
}
.sidebar-collapsed .main-content {
    /* margin-left: var(--sidebar-collapsed-width); */
}

.top-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    /* border-bottom: 1px solid var(--border-color); */
    height: 58px;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 99;
    transition: left 0.3s ease;
}
html[data-theme="dark"] .top-header {
    background-color: var(--secondary);
}

/* .sidebar-collapsed .top-header {
    left: var(--sidebar-collapsed-width);
} */

/* Header Logout Button */
.header-logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    margin-left: 1rem;
    transition: var(--transition);
}

.header-logout-button:hover {
    background-color: var(--error-color);
    color: white;
}

.header-logout-button i {
    font-size: 1.1rem;
}

/* User Info & Dropdown */
.user-info {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.875rem;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.dropdown-toggle:hover {
    background-color: var(--secondary);
}

.dropdown-toggle span {
    margin-right: 0.5rem;
    font-weight: 500;
}

.dropdown-toggle i {
    font-size: 1.25rem;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    width: 200px;
    background-color: var(--secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--secondary);
}

.dropdown-item i {
    margin-right: 0.75rem;
    width: 1rem;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

.logout-link {
    color: var(--error-color);
}

.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.logout-link i {
    color: var(--error-color);
}

/* Content */
.content {
    flex: 1;
    /* padding: 2rem; */
    /* background-color: var(--primary); */
    transition: background-color 0.3s ease;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    max-width: 400px;
    width: 100%;
}

.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px var(--shadow-color);
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #10B981;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #EF4444;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border-left: 4px solid #F59E0B;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

.alert .close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0 0 1rem;
    color: inherit;
    opacity: 0.7;
    transition: var(--transition);
}

.alert .close:hover {
    opacity: 1;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--secondary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    margin-left: 10px;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px var(--shadow-color);
}

/* Show/hide icons based on current theme */
.theme-toggle .light-icon,
.theme-toggle .dark-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    font-size: 14px;
}

.theme-toggle .light-icon {
    opacity: 0;
}

.theme-toggle .dark-icon {
    opacity: 1;
}

/* Adjust theme toggle position when in header */
.user-info .theme-toggle {
    position: relative;
    top: 0;
    left: 0;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .side-nav {
        transform: translateX(-100%);
    }
    
    .side-nav.collapsed {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
}

/* Dark Mode */
/* @media (prefers-color-scheme: dark) {
    html {
        --text-color: #F9FAFB;
        --text-secondary: #9CA3AF;
        --border-color: #374151;
        --light-gray: var(--secondary);
        --white: #111827;
        --bg-color: #111827;
        --card-bg: var(--secondary);
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
} */


/* Page Header */
.pageheader h1 {
    font-family: 'Segoe UI';
    font-weight: 600;
    font-style: Semibold;
    font-size: 1.1rem;
    line-height: 26px;
    letter-spacing: 0%;
    margin-left: 1rem;
    border-left:  1px solid #374151;
    padding-left: 1rem;
}
