/* Base Styles & Design Tokens */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #6366f1;
    --accent: #10b981;
    --background: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --premium-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: #1e293b;
    scroll-behavior: smooth;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .app-wrapper {
        flex-direction: row;
    }
}

.main-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 5rem;
}

@media (min-width: 1024px) {
    .main-content {
        padding-bottom: 2rem;
    }
}

/* Glassmorphism Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--premium-shadow);
}

/* Premium Navigation */
.nav-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Responsive Table / Card System */
.mobile-card-item {
    background: white;
    border-radius: 1.25rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

@media (min-width: 768px) {
    .mobile-card-item {
        display: none;
    }
}

@media (max-width: 767px) {
    .desktop-table {
        display: none;
    }
}

/* Inputs & Form Elements */
.premium-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    border-color: #4f46e5;
}

.premium-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 700;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.premium-btn:active {
    transform: scale(0.97);
}

.premium-btn-primary {
    background-color: #4f46e5;
    color: white;
}

.premium-btn-primary:hover {
    background-color: #4338ca;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
}

/* Custom Decorative Elements */
.bg-gradient-premium {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

.text-gradient {
    background: linear-gradient(to right, #4f46e5, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-blob {
    animation: blob 7s infinite;
}

/* Table Styling */
.premium-table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: separate;
    border-spacing: 0;
}

.premium-table th {
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    border-bottom: 2px solid #f1f5f9;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.premium-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    transition: background-color 0.15s;
}

.premium-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Card Enhancements */
.premium-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    padding: 2rem;
    border-radius: 1.5rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1);
}

@media (max-width: 640px) {
    .page-header {
        padding: 1.5rem;
        border-radius: 1.25rem;
    }
}

/* Classic Input Style - Now a Smooth Box */
.input-classic {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 0.75rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0.75rem 1rem !important;
    width: 100%;
    color: white;
}

/* Professional Smart Bar */
.smart-bar {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 1.5rem;
    transition: all 0.3s ease;
}

.smart-bar:focus-within {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.smart-bar input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.smart-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-container {
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-bottom-color: rgba(255, 255, 255, 0.9) !important;
}

.input-classic:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1) !important;
}

.input-classic::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Light theme classic input for white backgrounds */
.input-classic-light {
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    background: #f8fafc !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0.75rem 1rem !important;
    width: 100%;
    color: #1e293b;
}

.input-classic-light:focus {
    outline: none !important;
    border-color: #4f46e5 !important;
    background: white !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

.input-classic-light::placeholder {
    color: #94a3b8;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Premium Filter Styling */
.filter-select {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 0.6rem 2.25rem 0.6rem 1rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.filter-select option {
    background-color: white;
    color: #1e293b;
}

/* Sticky Mobile Summary */
.mobile-summary-bar {
    position: fixed;
    bottom: 4.5rem;
    left: 0;
    right: 0;
    background: white;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
}

@media (min-width: 1024px) {
    .mobile-summary-bar {
        display: none;
    }
}

/* Bottom Nav Padding for Mobile */
.pb-safe-area {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .main-content {
        padding-bottom: 0 !important;
    }
}