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

:root {
    --bg-color: #0f172a;
    --text-color: #0f172a;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --card-bg: rgba(30, 41, 59, 0.7);
    --sidebar-bg: rgba(15, 23, 42, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --sidebar-width: 260px;
    --input-bg: rgba(96, 120, 15, 0.2);
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --text-color: #0f172a;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #059669;
    --danger-color: #dc2626;
    --card-bg: rgba(255, 255, 255, 0.7);
    --sidebar-bg: rgba(248, 250, 252, 0.85);
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="ocean"] {
    --bg-color: #0c4a6e;
    --text-color: #f0f9ff;
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --accent-color: #14b8a6;
    --danger-color: #f43f5e;
    --card-bg: rgba(8, 47, 73, 0.7);
    --sidebar-bg: rgba(12, 74, 110, 0.85);
    --border-color: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(8, 47, 73, 0.5);
}

[data-theme="ruby"] {
    --bg-color: #2e5022;
    --text-color: #fce7f3;
    --primary-color: #e11d48;
    --primary-hover: #be123c;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --card-bg: rgba(76, 29, 58, 0.7);
    --sidebar-bg: rgba(54, 21, 41, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(54, 21, 41, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    /*background-color: var(--bg-color);*/
    /*background-color: silver;*/
    color: var(--text-color);
    color: blue;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
    /*background: var(--card-bg);*/
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    padding: 24px 0;
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 24px;
    color: var(--text-color);
    opacity: 0.8;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-color);
    opacity: 1;
    border-left-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-header {
    padding: 24px 40px;
    border-bottom: 1px solid var(--border-color);
}

.top-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.dashboard-container {
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Widgets */
.widget {
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.widget h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    font-weight: 400;
}

.widget .value {
    font-size: 2.5rem;
    font-weight: 700;
}

.descricao {
    font-size: 2.2rem;
    font-weight: 700;
}

.widget .value.success { color: var(--accent-color); }
.widget .value.danger { color: var(--danger-color); }

/* Forms & Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

input, select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Custom layout for simulator */
.simulator-widget {
    grid-column: 1 / -1;
}

.calc-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-top: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.btn-group {
    flex: 0 0 auto;
    width: 150px;
}

.resultado-simulacao {
    margin-top: 20px;
    font-weight: 600;
    color: var(--accent-color);
}

/* Charts */
.chart-widget {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Mobile Responsiveness */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .close-sidebar-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .top-header {
        padding-right: 70px; /* Space for the mobile button */
    }

    .calc-form {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-group {
        width: 100%;
    }
}

/* Utility Classes */
.full-width {
    grid-column: 1 / -1;
}

.info-text {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 10px;
}

.text-muted {
    color: #94a3b8;
    font-size: 0.9rem;
}

.theme-selector-container {
    padding: 0 24px;
    margin-top: 15px;
}

.theme-selector-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 5px;
    display: block;
}

.theme-selector-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.history-date {
    color: #94a3b8;
    font-size: 0.9em;
    margin-left: 15px;
}
