/* ========================================
   Allowed Accounting Iraq - Main Styles
   ======================================== */

/* Import Tailwind CSS (these would be processed by build tool) */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Root Variables */
:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    --font-arabic: 'Noto Sans Arabic', sans-serif;
    --font-english: 'Inter', sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-english);
}

html[lang="ar"] body,
html[dir="rtl"] body {
    font-family: var(--font-arabic);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .space-x-4> :not([hidden])~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

[dir="rtl"] .ml-3 {
    margin-left: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .pl-10 {
    padding-left: 0;
    padding-right: 2.5rem;
}

[dir="rtl"] .pr-10 {
    padding-right: 0;
    padding-left: 2.5rem;
}

[dir="rtl"] .left-3 {
    left: auto;
    right: 0.75rem;
}

[dir="rtl"] .right-3 {
    right: auto;
    left: 0.75rem;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
}

.sidebar-link {
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border: 1px solid #f3f4f6;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.card-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-input {
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #000000 !important;
    background-color: #ffffff !important;
    height: auto !important;
    min-height: 2.5rem !important;
    line-height: 1.5 !important;
}

select.form-input {
    appearance: auto !important;
    /* Re-enable default appearance if custom is failing */
    -webkit-appearance: auto !important;
}

select.form-input option {
    background-color: white !important;
    color: black !important;
    padding: 10px !important;
}

/* Specific fix for table selects */
table select.form-input {
    min-width: 150px !important;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

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

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

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background-color: #f9fafb;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: start;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.table tr:hover td {
    background-color: #f9fafb;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        font-size: 12pt;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* RTL Print Styles */
@media print {
    [dir="rtl"] {
        direction: rtl;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .sidebar-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
    }

    .sidebar-mobile-overlay.active {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 50;
        transition: left 0.3s;
    }

    [dir="rtl"] .sidebar {
        left: auto;
        right: -100%;
        transition: right 0.3s;
    }

    .sidebar.active {
        left: 0;
    }

    [dir="rtl"] .sidebar.active {
        left: auto;
        right: 0;
    }
}