/* 
   Sistema de Inventário - Theme & Design System
   Paleta: Fundo Verde Escuro (#051a11 - #0a2d1d)
   Botões: Verde Claro (#4ade80 / #2ecc71) alternando para Verde Escuro (#14472b / #1b5e3a)
*/

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

:root {
    --bg-dark: #051a11;
    --bg-dark-card: #0a261a;
    --bg-dark-input: #0e3323;
    --border-dark: #194d36;
    
    --green-light: #38e57c;
    --green-light-hover: #2cd06d;
    --green-light-text: #04140d;
    
    --green-dark-btn: #12402a;
    --green-dark-btn-hover: #185236;
    --green-dark-btn-text: #38e57c;

    --text-main: #f0fdf4;
    --text-muted: #86efac;
    --text-dim: #529471;
    
    --accent-emerald: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-glow: 0 0 25px rgba(56, 229, 124, 0.15);
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(20, 80, 50, 0.4) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(10, 45, 29, 0.6) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Base Wrapper */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    flex: 1;
}

/* Typography & Labels */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, var(--green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(10, 38, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: var(--transition-fast);
}

.glass-card:hover {
    border-color: rgba(56, 229, 124, 0.3);
}

/* Navbar */
.navbar {
    background: rgba(5, 26, 17, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-dark);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--green-light), var(--green-dark-btn-hover));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-size: 1.2rem;
    box-shadow: var(--shadow-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botões Customizados */
/* Botão Verde Claro Principal (Alterna para verde escuro ao passar o mouse ou ativar) */
.btn-green-light {
    background-color: var(--green-light);
    color: var(--green-light-text);
    border: 1px solid var(--green-light);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition-fast);
    box-shadow: 0 4px 14px rgba(56, 229, 124, 0.25);
}

.btn-green-light:hover, 
.btn-green-light:focus,
.btn-green-light.active {
    background-color: var(--green-dark-btn);
    color: var(--green-dark-btn-text);
    border-color: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 229, 124, 0.35);
}

/* Botão Verde Escuro (Alterna para verde claro ao passar o mouse ou ativar) */
.btn-green-dark {
    background-color: var(--green-dark-btn);
    color: var(--green-dark-btn-text);
    border: 1px solid var(--border-dark);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-green-dark:hover,
.btn-green-dark:focus,
.btn-green-dark.active {
    background-color: var(--green-light);
    color: var(--green-light-text);
    border-color: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(56, 229, 124, 0.25);
}

/* Toggle Switch de Botão */
.btn-toggle-state {
    transition: all 0.3s ease;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background-color: var(--bg-dark-input);
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(56, 229, 124, 0.15);
    background-color: #123e2c;
}

.input-plate {
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.25rem;
    text-align: center;
}

/* Counter Label (Destaque para Contagem de Cadastros) */
.counter-badge-card {
    background: linear-gradient(135deg, #0e3a26, #165337);
    border: 1px solid var(--green-light);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
}

.counter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.counter-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--green-light);
    text-shadow: 0 0 10px rgba(56, 229, 124, 0.4);
}

/* Camera & Upload Area */
.photo-uploader {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    background: rgba(14, 51, 35, 0.4);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.photo-uploader:hover {
    border-color: var(--green-light);
    background: rgba(14, 51, 35, 0.7);
}

.photo-preview {
    max-height: 220px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-top: 10px;
    display: none;
    border: 2px solid var(--green-light);
}

.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.camera-viewfinder {
    width: 100%;
    max-width: 500px;
    height: 380px;
    background: #000;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 3px solid var(--green-light);
}

/* Splash Screen */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--green-light), var(--green-dark-btn));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--bg-dark);
    margin-bottom: 24px;
    box-shadow: 0 0 40px rgba(56, 229, 124, 0.3);
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(56, 229, 124, 0.3); }
    100% { transform: scale(1.06); box-shadow: 0 0 50px rgba(56, 229, 124, 0.6); }
}

.splash-progress-bar {
    width: 220px;
    height: 6px;
    background: var(--bg-dark-input);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid var(--border-dark);
}

.splash-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--green-light);
    transition: width 0.05s linear;
}

/* Cards Layout for Inventory */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom Scrollbar for Cards Container */
.cards-container::-webkit-scrollbar {
    width: 6px;
}
.cards-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
.cards-container::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 10px;
}
.cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--green-light);
}

.inventory-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition-fast);
}

.inventory-card:hover {
    border-color: rgba(56, 229, 124, 0.3);
    background: rgba(56, 229, 124, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.btn-edit-card {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-edit-card:hover {
    background: #38bdf8;
    color: #fff;
}

.btn-delete-card {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
}

.btn-delete-card:hover {
    background: #ef4444;
    color: #fff;
}

.card-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.card-photo img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-dark);
    cursor: pointer;
    transition: var(--transition-fast);
}

.card-photo img:hover {
    border-color: var(--green-light);
    transform: scale(1.05);
}

.card-photo .no-photo {
    width: 70px;
    height: 70px;
    background: var(--bg-dark-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-dark);
    font-size: 1.5rem;
}

.card-details {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.badge-plate {
    font-family: 'JetBrains Mono', monospace;
    background: #12442d;
    color: var(--green-light);
    border: 1px solid var(--green-light);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-block;
}

.badge-sector {
    background: rgba(56, 229, 124, 0.15);
    color: var(--text-main);
    border: 1px solid rgba(56, 229, 124, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.thumb-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-dark);
    cursor: pointer;
    transition: var(--transition-fast);
}

.thumb-image:hover {
    transform: scale(1.15);
    border-color: var(--green-light);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(56, 229, 124, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-light);
    font-size: 1.5rem;
}

/* Alert messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--green-light);
    color: var(--green-light);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.user-badge-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 12px;
    border-left: 1px solid var(--border-dark);
    padding-left: 16px;
}

.mobile-toggle {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: var(--text-dim);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-dark);
    margin-top: auto;
}

/* Responsive & Mobile Hamburger Menu */
@media (max-width: 768px) {
    .app-container {
        padding: 14px;
    }
    .glass-card {
        padding: 20px;
    }
    
    .stats-grid {
        display: none !important;
    }
    
    .hide-on-mobile {
        display: none !important;
    }
    
    .hide-text-mobile {
        display: none !important;
    }
    
    .navbar-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        position: relative;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--bg-dark-input);
        border: 1px solid var(--border-dark);
        border-radius: var(--radius-md);
        color: var(--green-light);
        font-size: 1.3rem;
        cursor: pointer;
        transition: var(--transition-fast);
    }

    .mobile-toggle:hover,
    .mobile-toggle:focus {
        border-color: var(--green-light);
        background: #12402a;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        background: rgba(8, 30, 20, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--border-dark);
        border-radius: var(--radius-lg);
        margin-top: 12px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex !important;
        animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    .nav-links .btn-green-light,
    .nav-links .btn-green-dark {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .user-badge-nav {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-dark);
        padding-top: 14px;
        margin-top: 6px;
        justify-content: space-between;
        width: 100%;
    }

    .counter-badge-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
