/* public/css/style.css */
:root {
    --primary-color: #1e3a8a;
    /* Dark Navy Blue */
    --primary-color-hover: #172554;
    /* Darker Navy for hover */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --light-color: #f8fafc;
    --dark-color: #0f172a;

    --bg-color: #f1f5f9;
    /* Clean app background from reference */
    --sidebar-bg: rgba(30, 58, 138, 0.85);
    /* Translucent dark blue for glass effect */
    --sidebar-text: #94a3b8;
    --sidebar-width: 80px;
    --sidebar-expanded-width: 250px;

    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    /* Soft subtle shadow */
    --card-border-radius: 16px;
    /* Smooth rounded corners */
    --btn-border-radius: 8px;
    --input-border-radius: 8px;
}

body {
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)), url('../assets/images/login-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Card Styling & Entrance Animation */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.google-card {
    background: rgba(255, 255, 255, 0.45);
    /* More transparent to enhance glass effect */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--card-border-radius);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    /* Native glass shadow + Top Edge Highlight */
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2rem;
    /* Increased whitespace inside cards */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2rem;
    overflow: hidden;
    animation: fadeSlideUp 0.5s ease-out forwards;
}

.google-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 0.5rem;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    transition: width 0.3s ease;
    white-space: nowrap;
    /* Prevent text wrapping when collapsed */
}

/* Auto expand on hover */
.sidebar:hover {
    width: var(--sidebar-expanded-width);
}

.sidebar .sidebar-brand-text {
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    color: #ffffff;
    font-weight: 700;
}

.sidebar:hover .sidebar-brand-text {
    opacity: 1;
    visibility: visible;
}

.sidebar .nav-link {
    border-radius: 8px;
    /* Match standard UI */
    margin-bottom: 0.5rem;
    padding: 0.8rem 1rem;
    /* Better padding for text */
    color: var(--sidebar-text);
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    justify-content: flex-start;
    /* Align to the left instead of center */
    align-items: center;
}

.sidebar .nav-link span {
    display: inline-block;
    /* Show text for the transition */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.sidebar:hover .nav-link span {
    opacity: 1;
    visibility: visible;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    min-width: 30px;
    /* Constrain icon width so text aligns perfectly */
    text-align: center;
    margin-right: 15px !important;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    /* Removed the transform jump for a cleaner feel */
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 500;
}

.sidebar hr {
    margin: 1.5rem 0;
    opacity: 0.1;
    border-color: #ffffff;
}

/* Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* Typography & Elements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #0f172a;
    /* Darker, richer text for headings */
    letter-spacing: -0.02em;
    /* Tighter letter spacing for modern look */
    margin-bottom: 1rem;
}

.text-muted {
    color: #64748b !important;
    /* Better contrast secondary text */
}

/* Buttons */
.btn {
    border-radius: var(--btn-border-radius);
    padding: 0.65rem 1.75rem;
    /* Slightly larger click target */
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: translateY(1px);
    /* Tactile click effect */
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-color-hover) 100%);
    border: 1px solid var(--primary-color-hover);
    box-shadow: 0 4px 14px 0 rgba(30, 58, 138, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    /* Soft glow + top reflex */
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px 0 rgba(30, 58, 138, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: linear-gradient(180deg, var(--primary-color-hover) 0%, #152042 100%);
    transform: translateY(-1px);
}

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

.btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--input-border-radius);
    border: 1px solid rgba(203, 213, 225, 0.8);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.2rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    /* Neuromorphic inner shadow */
    transition: all 0.2s ease-in-out;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15), inset 0 2px 4px 0 rgba(0, 0, 0, 0.01);
    /* Sharp precision focus ring */
    background-color: #ffffff;
}

/* Tables */
.table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    /* Allows for cleaner modern row spacing if needed later */
    border-spacing: 0;
}

.table thead th {
    background-color: transparent;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.70rem;
    padding: 0.8rem;
    white-space: nowrap;
    /* Prevent header wrapping */
}

.table tbody td {
    padding: 0.8rem;
    /* Reduced from 1.25rem to prevent CNPJ/data wrapping */
    /* Generous padding */
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    /* Extremely light border */
    color: #334155;
    font-weight: 500;
    font-size: 0.95rem;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Badges */
.badge {
    border-radius: 8px;
    padding: 0.55em 0.9em;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../assets/images/login-bg.png');
    /* The new generated background */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* Optional gentle dark overlay if the image is too bright */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    /* Slight blur to the background */
    -webkit-backdrop-filter: blur(4px);
    z-index: 0;
}

.login-box {
    width: 100%;
    max-width: 480px;
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 1;

    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.75);
    /* Highly translucent white */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Mobile Responsiveness */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* Darker overlay */
    backdrop-filter: blur(2px);
    /* Modern blur effect */
    z-index: 1030;
}

@media (max-width: 991.98px) {

    /* Hide the old sliding sidebar completely on mobile */
    .sidebar,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 90px;
        /* Space for mobile header */
        padding-bottom: 90px;
        /* Space for bottom navigation bar */
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Bottom Navigation App Bar Styles */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(255, 255, 255, 0.85);
        /* Glass effect */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
        z-index: 1050;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        text-decoration: none;
        color: #64748b;
        transition: color 0.2s ease, transform 0.2s ease;
        padding-top: 5px;
    }

    .bottom-nav-item i {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }

    .bottom-nav-item span {
        font-size: 0.70rem;
        font-weight: 500;
        letter-spacing: -0.01em;
    }

    .bottom-nav-item.active {
        color: var(--primary-color);
        transform: translateY(-2px);
    }

    .bottom-nav-item:active {
        transform: translateY(2px) scale(0.95);
    }
}

/* Gradient Cards (Google Colors) */
.google-card.card-gradient-blue {
    background: linear-gradient(135deg, #4285f4 0%, #3b78e7 100%) !important;
    /* Google Blue */
    color: white !important;
}

.google-card.card-gradient-green {
    background: linear-gradient(135deg, #0f9d58 0%, #0b8043 100%) !important;
    /* Google Green */
    color: white !important;
}

.google-card.card-gradient-red {
    background: linear-gradient(135deg, #db4437 0%, #c53929 100%) !important;
    /* Google Red */
    color: white !important;
}

.google-card.card-gradient-orange {
    background: linear-gradient(135deg, #f4b400 0%, #f0a000 100%) !important;
    /* Google Yellow */
    color: white !important;
}

.card-gradient-text-white {
    color: rgba(255, 255, 255, 0.9);
}

.card-gradient-icon {
    color: rgba(255, 255, 255, 0.8) !important;
}

@media (max-width: 575.98px) {
    .google-card {
        padding: 1.25rem !important;
        border-radius: 12px;
        /* Slightly smaller on mobile */
    }

    .main-content {
        padding: 1rem;
        padding-top: 85px;
    }

    h2 {
        font-size: 1.5rem;
    }
}