/* PNRev - Professional Airline Commission Management Platform */
/* Tailwind-inspired utility CSS framework */

/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
}

/* Typography utilities */
.font-inter { font-family: 'Inter', sans-serif; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

/* Color utilities */
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-blue-400 { color: #60a5fa; }
.text-green-500 { color: #10b981; }
.text-green-600 { color: #059669; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-yellow-500 { color: #eab308; }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-800 { background-color: #1f2937; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-50 { background-color: #ecfdf5; }
.bg-green-500 { background-color: #10b981; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-50 { background-color: #fffbeb; }

/* Spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.m-8 { margin: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-8 { margin-left: 2rem; }
.ml-auto { margin-left: auto; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-6 { padding-top: 1.5rem; }

/* Layout utilities */
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.relative { position: relative; }
.absolute { position: absolute; }
.z-50 { z-index: 50; }

.w-4 { width: 1rem; }
.w-8 { width: 2rem; }
.w-48 { width: 12rem; }
.h-4 { height: 1rem; }
.h-8 { height: 2rem; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }

.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Border utilities */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-700 { border-color: #374151; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Shadow utilities */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Component-specific styles */

/* Navigation */
.nav-header {
    position: sticky;
    top: 0;
    z-index: 40;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.nav-link:hover {
    color: #1f2937;
    background-color: #f3f4f6;
}

.nav-link.active {
    color: #2563eb;
    background-color: #eff6ff;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #2563eb;
    background-color: #eff6ff;
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 12rem;
    background-color: #ffffff;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 50;
}

.user-menu.hidden {
    display: none;
}

.user-menu a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    transition: background-color 0.15s ease-in-out;
}

.user-menu a:hover {
    background-color: #f3f4f6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #14b8a6 0%, #10b981 100%);
    color: #ffffff;
    border: 1px solid #14b8a6;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, #059669 100%);
    border-color: #0f766e;
}

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

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

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

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Cards */
.card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

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

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    color: #374151;
}

.loading-spinner i {
    font-size: 2rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
    .md\:flex { display: flex; }
    .md\:flex-row { flex-direction: row; }
    .md\:ml-8 { margin-left: 2rem; }
    .md\:mt-0 { margin-top: 0; }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:col-span-4 { grid-column: span 4 / span 4; }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Custom grid utilities */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.gap-8 { gap: 2rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-8 > * + * { margin-left: 2rem; }

/* Focus utilities */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.focus\:ring-offset-2:focus { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(37, 99, 235, 0.1); }
.focus\:ring-inset:focus { box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.1); }

/* Hover utilities */
.hover\:text-gray-500:hover { color: #6b7280; }
.hover\:text-gray-600:hover { color: #4b5563; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }

/* Transition utilities */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; }
.transition-all { transition-property: all; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }

/* Main content layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-header {
    flex-shrink: 0;
}

.content-area {
    flex: 1;
}

.footer {
    flex-shrink: 0;
}

/* Additional utilities for PNRev-specific components */
.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-alert {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

/* Animation utilities */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Billing Alert Styles */
.billing-alert {
    margin-bottom: 24px;
}

.billing-alert .alert {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    border-radius: 8px;
    padding: 16px;
}

.billing-alert .alert-content {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.billing-alert .alert-icon {
    margin-right: 12px;
    color: #f59e0b;
    font-size: 16px;
    flex-shrink: 0;
}

.billing-alert .alert-text h4 {
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #92400e;
    font-size: 16px;
    line-height: 1.4;
}

.billing-alert .alert-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #92400e;
}

.billing-alert .alert-actions {
    display: flex;
    margin-left: 16px;
    margin-top: 0;
}

.billing-alert .alert-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.billing-alert .alert-actions .btn:disabled.success {
    opacity: 1;
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.billing-alert .alert-actions .btn:disabled .fa-check {
    color: white;
}

/* Global Payment Alert */
.global-payment-alert {
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
    margin-bottom: 24px;
}

.global-payment-alert .alert {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 16px;
    margin: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Custom properties for theme customization */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #eab308;
    --info-color: #3b82f6;
}

/* Progress notification animations */
@keyframes slideInFromTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}
