@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* White/Light Theme Palette */
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-hover: #ffffff;
    --primary: #000000;
    --primary-hover: #333333;
    --accent: #ffd700; 
    --text-main: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --danger: #dc3545; 
    --success: #198754; 
    --warning: #ffc107;
    
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glow: 0 0 20px rgba(0, 0, 0, 0.1);
    
    --header-height: 70px;
}

[data-theme="dark"] {
    /* Dark Blue Theme Palette */
    --bg-body: #0f172a; /* Slate 900 - Dark Blue */
    --bg-surface: #1e293b; /* Slate 800 - Lighter Blue for Cards */
    --bg-surface-hover: #334155; /* Slate 700 */
    --primary: #38bdf8; /* Sky 400 - Bright Blue for primary actions */
    --primary-hover: #0ea5e9; /* Sky 500 */
    --accent: #ffd700; /* Gold stays gold */
    --text-main: #ffffff; /* Pure White */
    --text-muted: #ffffff; /* Force muted text to be white as well per user request "todas as letras brancas" */
    --border: #334155; /* Slate 700 */
    --danger: #ef4444; 
    --success: #22c55e; 
    --warning: #f59e0b;
    
    --glass: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(56, 189, 248, 0.2);
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Helper to force dark/light backgrounds on specific elements if needed */
.bg-surface { background-color: var(--bg-surface) !important; }
.text-main { color: var(--text-main) !important; }

/* Override bootstrap utilities for theme compatibility */
[data-theme="dark"] .bg-white { background-color: var(--bg-surface) !important; color: var(--text-main) !important; }
[data-theme="dark"] .bg-light { background-color: var(--bg-body) !important; color: var(--text-main) !important; }
[data-theme="dark"] .text-dark { color: var(--text-main) !important; }
[data-theme="dark"] .text-black { color: var(--text-main) !important; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .text-secondary { color: var(--text-muted) !important; }
[data-theme="dark"] .text-body { color: var(--text-main) !important; }
[data-theme="dark"] .border-light { border-color: var(--border) !important; }
[data-theme="dark"] .card { background-color: var(--bg-surface); border-color: var(--border); color: var(--text-main); }
[data-theme="dark"] .navbar-custom { background-color: var(--bg-body); border-bottom: 1px solid var(--border); }
[data-theme="dark"] .dropdown-menu { background-color: var(--bg-surface); border-color: var(--border); }
[data-theme="dark"] .dropdown-item { color: var(--text-main); }
[data-theme="dark"] .dropdown-item:hover { background-color: var(--bg-surface-hover); color: #ffffff; }
[data-theme="dark"] .form-control { background-color: var(--bg-body); border-color: var(--border); color: var(--text-main); }
[data-theme="dark"] .form-control:focus { background-color: var(--bg-body); color: var(--text-main); border-color: var(--primary); }
[data-theme="dark"] .form-control::placeholder { color: var(--text-muted); }
[data-theme="dark"] .table { color: var(--text-main); }
[data-theme="dark"] .table thead th { color: var(--text-main); border-color: var(--border); background-color: var(--bg-surface); }
[data-theme="dark"] .table td { border-color: var(--border); color: var(--text-main); }
[data-theme="dark"] .modal-content { background-color: var(--bg-surface); border: 1px solid var(--border); color: var(--text-main); }
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer { border-color: var(--border); }
[data-theme="dark"] .close, [data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* Fix invisible buttons in dark mode */
[data-theme="dark"] .btn-outline-dark {
    color: var(--text-main);
    border-color: var(--text-main);
}
[data-theme="dark"] .btn-outline-dark:hover {
    background-color: var(--text-main);
    color: var(--bg-body);
}
[data-theme="dark"] .btn-light {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
    border-color: var(--border);
}
[data-theme="dark"] .btn-light:hover {
    background-color: var(--border);
    color: #ffffff;
}
[data-theme="dark"] .btn-white {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
    border-color: var(--border);
}
[data-theme="dark"] .btn-link {
    color: var(--primary);
}


main {
    flex: 1;
}

/* Animations */
.hover-scale {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-scale:hover {
    transform: scale(1.05);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.floating-card-1 {
    animation: float 6s ease-in-out infinite;
}

.floating-card-2 {
    animation: float 5s ease-in-out infinite;
    animation-delay: 1s;
}

.bg-gradient-dark {
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
}

.shadow-success {
    box-shadow: 0 4px 20px rgba(25, 135, 84, 0.3);
}

/* Removed unused animations to clean up */

/* Custom Buttons for Header */
/* Reverted to Bootstrap classes in HTML, keeping only essential overrides if any */


/* User Dropdown */
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    background: rgba(0,0,0,0.05);
    border-radius: 30px;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.user-dropdown-toggle:hover, .user-dropdown-toggle[aria-expanded="true"] {
    background: rgba(0,0,0,0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.user-avatar-placeholder {
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dropdown-menu-animate {
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-top: 15px !important;
    border-radius: 16px;
    overflow: hidden;
}

/* Navigation Custom */
.nav-link-custom {
    color: var(--primary) !important;
    opacity: 0.8;
    transition: all 0.3s ease;
}
.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--primary) !important;
    opacity: 1;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.nav-icon-custom {
    color: var(--primary) !important;
    transition: all 0.3s ease;
}
.nav-icon-custom:hover {
    color: var(--accent) !important;
    transform: scale(1.1);
}

.navbar-custom {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    min-height: var(--header-height);
}

.navbar-brand-custom {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

/* Restored Price Tag */
.price-tag {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.current-price {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.payment-info {
    color: #666;
    font-size: 0.75rem;
    margin-top: 4px;
    margin-bottom: 1rem;
}

.action-row {
    display: flex;
    gap: 0.5rem;
}

.btn-buy {
    width: 100%; /* Ensure button fills the form container */
    background-color: var(--accent);
    color: #000;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    font-size: 1rem;
    transition: background-color 0.2s;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

.btn-buy:hover {
    background-color: #ffea00;
    color: #000;
}

.btn-cart-icon {
    width: 54px;
    background-color: #fff;
    color: var(--accent);
    border: 1px solid #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.2s;
}

.btn-cart-icon:hover {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.flash-icon {
    color: var(--accent);
}


/* Category Cards */
.category-card {
    position: relative;
    transition: transform 0.3s ease;
    background: linear-gradient(45deg, var(--bg-surface), #f8f9fa);
}

.category-card:hover {
    transform: scale(1.05);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 0, 0, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Auth Pages (Login/Register) - Vibrant Theme */
:root {
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(0, 0, 0, 0.05);
    --input-border: rgba(0, 0, 0, 0.1);
    --input-focus: #8b5cf6;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #f8f9fa; /* Simple background instead of noise filter */
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-card {
    display: flex;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    z-index: 1;
}

.auth-sidebar {
    flex: 1;
    background: var(--gradient-primary);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-sidebar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&q=80') center/cover;
    opacity: 0.1;
    mix-blend-mode: overlay;
}

.auth-content {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
}

.auth-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.auth-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: black;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input:focus {
    background: #fff;
    border-color: var(--input-focus);
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
}

.auth-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.4);
    transition: color 0.3s ease;
}

.auth-input:focus + .auth-icon {
    color: var(--input-focus);
}

.social-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: #fff;
}

.btn-light {
    background-color: #fff;
    color: #000;
}

/* Footer */
footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        flex-direction: column;
        max-width: 500px;
    }
    
    .auth-sidebar {
        padding: 2rem;
        min-height: 150px;
    }
    
    .auth-content {
        padding: 2rem;
    }
    
    .hero-section {
        text-align: center;
    }
    
    .hero-section .row {
        flex-direction: column-reverse;
    }
    
    .hero-section img {
        margin-bottom: 2rem;
        max-height: 300px;
    }
}

/* Admin Layout & Sidebar */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Fix for Admin Dashboard Layout with Fixed Header */
#wrapper .sidebar,
.admin-layout .sidebar {
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    z-index: 1020;
}

#wrapper #page-content-wrapper,
.admin-layout .main-content {
    margin-top: var(--header-height);
}

.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.main-content, #page-content-wrapper {
    flex: 1;
    margin-left: 260px; /* Width of sidebar */
    padding: 0;
    background-color: var(--bg-body);
    width: calc(100% - 260px); /* Ensure it doesn't overflow */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar-brand {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
}

.sidebar-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.sidebar-link.active {
    background-color: var(--primary);
    color: #fff;
}

/* Admin Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Dashboard Footer */
.dash-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-top: 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.footer-col h5 {
    color: var(--text-main);
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.social-icons a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.2s;
}

.social-icons a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* Ensure placeholders are visible */
::placeholder {
    color: var(--text-muted) !important; 
    opacity: 1; /* Firefox */
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
    color: var(--text-muted) !important;
}

::-ms-input-placeholder { /* Microsoft Edge */
    color: var(--text-muted) !important;
}

/* Service Cards & Custom Elements moved from index.ejs */
:root {
    --service-card-bg: #ffffff;
    --service-card-hover: #f8f9fa;
    --modal-bg: #ffffff;
}

[data-theme='dark'] {
    --service-card-bg: var(--bg-surface);
    --service-card-hover: var(--bg-surface-hover);
    --modal-bg: var(--bg-surface);
}

.service-card {
    background: var(--service-card-bg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: var(--text-main);
}
.service-card:hover {
    background: var(--service-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text-main);
}
.service-icon {
    width: 60px;
    height: 60px;
    background: rgba(115, 103, 240, 0.1);
    color: #7367f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
}
[data-theme='dark'] .service-icon {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.price-badge {
    background: var(--success);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}
.status-badge {
    background: var(--warning);
    color: #000;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Modal Styles */
.custom-modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
}
.custom-modal-header {
    border-bottom: 1px solid var(--border);
}
.custom-modal-footer {
    border-top: 1px solid var(--border);
}

