/* 
 * Premium Light Mode UI/UX
 * Vibe: Clean, Modern, Glassmorphism elements, Soft shadows
 */

 :root {
    --primary-color: #4361ee;
    --primary-hover: #3a0ca3;
    --secondary-color: #f72585;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius-md: 16px;
    --radius-lg: 24px;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

body {
    background-color: #ffffff;
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    padding-top: 20px; /* Space for top floating icons */
    padding-bottom: 24px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* Logo Sizing */
.main-logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.main-logo-container img {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* Containers & Cards */
.container, .container-main, .container-fluid {
    width: 100%;
    max-width: 100% !important;
    margin: 0 auto;
    padding: 0 10px !important;
}

.card, .summary-card, .login-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-container {
    max-width: 400px !important;
    margin: 40px auto !important;
}

.dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.stat-pill {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.hero-vibe {
    position: relative;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.dashboard-card .card-title {
    color: var(--text-main);
}

.dashboard-card .card-text {
    color: var(--text-muted);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Inputs & Forms */
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    font-size: 1rem;
    background-color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
    outline: none;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

/* Tables */
.table-responsive {
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: visible;
    min-height: 250px;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
    background: white;
    margin-bottom: 24px;
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table thead th {
    background-color: #f1f3f5;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 4px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.85rem;
}

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

.table th:last-child,
.table td:last-child {
    text-align: center !important;
    min-width: 80px;
}

.table tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.02);
}

/* Badges & Status */
.balance-due.positive, .balance-positive {
    color: #e74c3c;
    font-weight: 700;
}

.balance-due.negative, .balance-due.zero, .balance-zero {
    color: #2ecc71;
    font-weight: 700;
}

.grand-summary-bar {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
}

.grand-summary-bar span {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.grand-summary-bar b {
    color: var(--text-main);
    font-size: 1.3rem;
    display: block;
    margin-top: 4px;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1050;
    pointer-events: none; /* Let clicks pass through the empty space */
}

.top-nav-left, .top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto; /* Re-enable clicks on the icons */
}

.nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-icon:hover {
    background: #f8fafc;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logout-icon:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

@media print {
    .top-nav {
        display: none !important;
    }
    body {
        padding-top: 0 !important;
        background: white !important;
    }
    .container {
        width: 100% !important;
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 10px;
    }
    
    .top-nav {
        padding: 0 10px;
    }
    
    .grand-summary-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .table-responsive {
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }
}

/* iPhone 16 & Mobile specific */
@media (max-width: 430px) {
    body {
        padding-top: 50px;
    }
    .top-nav {
        height: 50px;
    }
    .nav-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    .card, .summary-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    .card-title {
        font-size: 1.1rem;
    }
    .table tbody td {
        font-size: 0.8rem;
        padding: 4px 6px;
    }
    .table thead th {
        font-size: 0.7rem;
        padding: 5px 6px;
    }
    h2, h3 {
        font-size: 1.5rem;
    }
}

/* Action Hamburger Styling */
.action-hamburger {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-muted);
    padding: 2px 10px;
    font-size: 1.1rem;
}

.action-hamburger:hover, .action-hamburger:focus {
    color: var(--primary-color);
    background: rgba(0,0,0,0.05);
}

.action-hamburger::after {
    display: none; /* Hide default bootstrap caret */
}

.dropdown-item {
    font-size: 0.9rem;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    color: white;
}

/* Animated Search */
.animated-search-container { display: flex; justify-content: flex-end; }
.animated-search-wrapper { position: relative; display: inline-flex; align-items: center; background: #fff; border: 1px solid #ced4da; border-radius: 50px; height: 40px; overflow: hidden; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 40px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.075); }

/* Animated Search */
.animated-search-container { display: flex; justify-content: flex-end; }
.animated-search-wrapper { position: relative; display: inline-flex; align-items: center; background: #fff; border: 1px solid #ced4da; border-radius: 50px; height: 40px; overflow: hidden; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 40px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.075); }
.animated-search-wrapper.expanded { width: 100%; max-width: 400px; border-color: #4361ee; box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25); }
.animated-search-input { border: none; outline: none; padding: 0 15px 0 40px; width: 100%; height: 100%; background: transparent; opacity: 0; transition: opacity 0.3s ease; font-size: 0.95rem; }
.animated-search-wrapper.expanded .animated-search-input { opacity: 1; }
.animated-search-icon { position: absolute; left: 0; top: 0; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; cursor: pointer; background: transparent; color: #6c757d; z-index: 2; transition: color 0.3s ease; }
.animated-search-wrapper.expanded .animated-search-icon { color: #4361ee; }
/* Fix FontAwesome FOUC */
.fas, .fab, .far, .fa { display: inline-block; min-width: 1.25em; text-align: center; }

/* ==========================================================================
   Star Flex Printing - Vibrant Modern Landing & Homepage Theme
   ========================================================================== */
.gradient-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: #0f172a;
    display: inline-block;
}

.letterpad-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: #0f172a;
    display: inline-block;
    text-transform: uppercase;
}

.letterpad-tagline {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    color: #334155;
}

.hero-vibe {
    position: relative;
    padding: 40px 20px;
    background: #ffffff !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(67, 97, 238, 0.1);
    border: 1px solid rgba(67, 97, 238, 0.2);
    border-radius: 50px;
    color: var(--primary-color);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.btn-vibe-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-vibe-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(67, 97, 238, 0.5);
    color: #ffffff;
}

.btn-vibe-outline {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    border: 2px solid #e2e8f0;
    padding: 11px 26px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-vibe-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.vibe-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-md);
    padding: 28px 22px;
    height: 100%;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.vibe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4361ee, #f72585);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vibe-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 35px rgba(67, 97, 238, 0.12);
    border-color: rgba(67, 97, 238, 0.3);
}

.vibe-card:hover::before {
    opacity: 1;
}

.icon-box-vibe {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.icon-blue { background: rgba(67, 97, 238, 0.1); color: #4361ee; }
.icon-purple { background: rgba(114, 9, 183, 0.1); color: #7209b7; }
.icon-pink { background: rgba(247, 37, 133, 0.1); color: #f72585; }
.icon-cyan { background: rgba(76, 201, 240, 0.12); color: #00b4d8; }

.stat-pill {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Glass Modal for Admin Login */
.modal-content-glass {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header-vibe {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(114, 9, 183, 0.05));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px 30px;
}

.form-floating-vibe .form-control {
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-floating-vibe .form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.transition-scale:hover {
    transform: scale(1.06);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ==========================================================================
   Mobile Optimization & Responsive Layout
   ========================================================================== */
html, body {
    background-color: #ffffff !important;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    body {
        background-color: #ffffff !important;
        padding-top: 15px;
    }

    .hero-vibe {
        padding: 20px 10px !important;
        background: #ffffff !important;
        margin-bottom: 20px;
    }

    .display-3 {
        font-size: 2rem !important;
        letter-spacing: -1px !important;
        line-height: 1.2;
    }

    .gradient-text {
        font-size: 2rem !important;
        letter-spacing: -1px !important;
    }

    .lead {
        font-size: 0.95rem !important;
        padding: 0 5px;
    }

    .fs-3 {
        font-size: 1.2rem !important;
    }

    .hero-vibe img {
        max-width: 125px !important;
    }

    .stat-pill {
        padding: 12px 8px !important;
    }

    .stat-number {
        font-size: 1.4rem !important;
    }

    .btn-lg {
        padding: 10px 18px !important;
        font-size: 0.95rem !important;
    }

    .vibe-card {
        padding: 20px 16px !important;
    }

    .position-fixed.top-0.end-0 {
        padding: 10px !important;
    }

    .position-fixed.top-0.end-0 button {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
}

/* Floating WhatsApp Button for Star Flex Printing */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #ffffff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.65);
    color: #ffffff !important;
}
