/* ============================================
   Madarej Admin Panel Styles
   Brand Colors: Blue-Purple Gradient
   ============================================ */

/* Fonts from Frontend */
@font-face {
    font-family: 'Alfont Com Rubik';
    src: url('../fonts/alfont_com_Rubik-ExtraBold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alfont Com Foda Free Font';
    src: url('../fonts/ReadexPro.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alfont Com Arabicpoetry';
    src: url('../fonts/alfont_com_ArabicPoetry-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #4f7df3;
    --primary-hover: #3d68d8;
    --primary-gradient: linear-gradient(135deg, #4f7df3 0%, #9b59b6 100%);
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #a1a5b7;
    --sidebar-active: #ffffff;
    --body-bg: #f5f8fa;
    --card-bg: #ffffff;
    --text-dark: #181c32;
    --text-muted: #7e8299;
    --success: #50cd89;
    --warning: #ffc700;
    --danger: #f1416c;
    --info: #9b59b6;
}

* {
    font-family: 'Alfont Com Foda Free Font', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

body {
    background-color: var(--body-bg);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700 !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-brand {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(79, 125, 243, 0.1);
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.sidebar-brand .brand-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.sidebar-brand h2 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.sidebar-brand .brand-icon {
    font-size: 1.8rem;
    margin-left: 10px;
    color: var(--primary-color);
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sidebar-text);
    opacity: 0.6;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.menu-item i {
    font-size: 1.2rem;
    margin-left: 12px;
    width: 24px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-active);
}

.menu-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
}

.menu-icon-svg {
    width: 20px;
    height: 20px;
    margin-left: 12px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.menu-item:hover .menu-icon-svg,
.menu-item.active .menu-icon-svg {
    opacity: 1;
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
}

.main-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid #e4e6ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    transition: all 0.3s ease;
}

.admin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-info {
    text-align: right !important;
}

.dropdown-item {
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.dropdown-item.text-danger:hover {
    background-color: var(--danger) !important;
    color: #fff !important;
}

.header-actions .dropdown .btn:focus {
    box-shadow: none;
}

.header-actions .dropdown .btn:hover .admin-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(79, 125, 243, 0.3) !important;
}

.dropdown-menu {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #f1f1f2 !important;
}

.dropdown-item i {
    font-size: 1.1rem;
    vertical-align: middle;
}

.content-wrapper {
    padding: 30px;
}

/* Stats Cards */
.stats-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

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

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stats-icon.success {
    background: rgba(80, 205, 137, 0.1);
    color: var(--success);
}

.stats-icon.warning {
    background: rgba(255, 199, 0, 0.1);
    color: var(--warning);
}

.stats-icon.danger {
    background: rgba(241, 65, 108, 0.1);
    color: var(--danger);
}

.stats-icon.info {
    background: rgba(114, 57, 234, 0.1);
    color: var(--info);
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 15px 0 5px;
}

.stats-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Data Cards */
.data-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: 100%;
    /* Ensure uniform height */
    display: flex;
    flex-direction: column;
}

.data-card .card-body {
    flex: 1;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e4e6ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 25px;
}

/* Tables */
.table {
    margin: 0;
}

.table thead th {
    background: #f5f8fa;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 15px;
}

.table tbody td {
    padding: 16px 20px;
    vertical-align: middle;
    border-color: #f1f1f2;
    text-align: right;
    font-size: 0.95rem;
}

.table tbody tr:hover {
    background: #f5f8fa;
}

/* Buttons */
.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning {
    border-radius: 12px;
    transition: all 0.3s ease;
    border-width: 1px;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 10px 20px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* Badges */
.badge {
    padding: 6px 10px;
    font-weight: 500;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border-color: #e4e6ef;
    padding: 10px 15px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.login-logo p {
    color: var(--text-muted);
    margin-top: 10px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 5px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Thumbnail Preview */
.thumbnail-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

/* Status Badge */
.status-active {
    background: rgba(80, 205, 137, 0.1);
    color: var(--success);
}

.status-inactive {
    background: rgba(241, 65, 108, 0.1);
    color: var(--danger);
}

/* OMR Currency Styling */
.currency-badge {
    background: #eef2ff;
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.input-group-text.omr-addon {
    background: #f8f9fa;
    border-color: #e4e6ef;
    color: var(--primary-color);
    font-weight: 700;
}