/**
 * Custom CSS Stylesheet for Stockify App
 * Focuses on a premium glassmorphic feel, clean dashboard UI, responsive typography, and customized autocomplete lists.
 */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --dark-bg: #0f172a;
    --sidebar-width: 260px;
    --body-bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(226, 232, 240, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

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

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #ffffff;
    background-color: var(--primary-color);
}

.nav-item.active i {
    color: #ffffff !important;
}

.text-success-indicator {
    color: var(--success-color);
}

.text-danger-indicator {
    color: var(--danger-color);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.text-muted-custom {
    color: #64748b;
    font-size: 0.8rem;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* App Header */
.app-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    padding: 0.25rem;
}

.header-title {
    font-size: 1.35rem;
    margin: 0;
    font-weight: 700;
}

.header-icon {
    font-size: 1.2rem;
}

.text-indigo {
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-datetime {
    background-color: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Content Body */
.content-body {
    padding: 2rem;
    flex: 1;
}

/* Premium Card Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header-custom {
    padding: 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title-custom {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.card-body-custom {
    padding: 1.5rem;
}

/* Dashboard Metrics & Visuals */
.metric-card {
    position: relative;
    border-left: 5px solid var(--primary-color);
}
.metric-card.success-metric {
    border-left-color: var(--success-color);
}
.metric-card.danger-metric {
    border-left-color: var(--danger-color);
}

.metric-icon {
    font-size: 2.25rem;
    opacity: 0.15;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

/* Custom Styled Tables */
.table-responsive-custom {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-custom {
    width: 100%;
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f8fafc;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.table-custom td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table-custom tr:last-child td {
    border-bottom: none;
}

.table-custom tbody tr {
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.02);
}

/* Custom Autocomplete Auto Suggest Styles */
.autocomplete-wrapper {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 1);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    max-height: 250px;
    overflow-y: auto;
    margin-top: 6px;
    display: none;
    padding: 0.25rem 0;
}

.suggestion-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 0.95rem;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.suggestion-stock-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Custom Form Styling */
.form-group-custom {
    margin-bottom: 1.25rem;
}

.form-label-custom {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.form-control-custom {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #ffffff;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.btn-custom {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary-custom:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;
}

/* Custom Badges */
.badge-custom {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    display: inline-block;
}

.badge-custom-success {
    background-color: var(--success-light);
    color: #047857;
}

.badge-custom-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
}

.badge-custom-neutral {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

/* Custom Alerts */
.alert-custom {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: slideIn 0.25s ease-out;
}

.alert-custom-success {
    background-color: var(--success-light);
    color: #065f46;
}

.alert-custom-danger {
    background-color: var(--danger-light);
    color: #991b1b;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-content {
    flex: 1;
    font-weight: 500;
}

/* Keyframe Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive Overrides */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    
    .app-sidebar.show {
        transform: translateX(0);
    }
    
    .app-main {
        margin-left: 0;
    }
    
    .app-header {
        padding: 1rem 1.5rem;
    }
    
    .content-body {
        padding: 1.5rem;
    }
}
