/* === Theme Variables === */
:root {
    --bg-color: #0f172a;
    --dashboard-wrapper-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --sidebar-color: #f1f5f9;
    --topbar-bg: #1e293b;
    --text-color: #f1f5f9;
    --close-btn-color: #fff;
    --hover-bg: #334155;
    --active-bg: #2563eb;
    --link-color: #2563eb;
    --card-bg: #1e293b;
    --border-color: rgba(255, 255, 255, 0.1);
    --credit-border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.5);
}

.light-theme {
    --bg-color: #f4f6f8;
    --dashboard-wrapper-bg: #f9f9f9;
    --sidebar-bg: #1e293b;
    --sidebar-color: #f1f5f9;
    --topbar-bg: #ffffff;
    --text-color: #111827;
    --close-btn-color: #fff;
    --hover-bg: #334155;
    --active-bg: #2563eb;
    --link-color: #2563eb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --credit-border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* === Base Layout === */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
}

a {
    text-decoration: none;
    color: var(--link-color);
}

a:hover {
    text-decoration: underline;
}

.dashboard-wrapper {
    display: flex;
    max-width: 800px;
    width: 100%;
    background: var(--dashboard-wrapper-bg);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    box-shadow: 0 0 8px var(--shadow-color);
}

/* === Sidebar === */
.sidebar {
    width: 200px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 1rem;
    box-sizing: border-box;
    position: relative;
}

.sidebar h2 {
    font-size: 1.1rem;
    margin: 0 1rem 1rem;
}

/* === Sidebar Menu === */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar li {
    margin: 0;
}

.sidebar a {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--sidebar-color);
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
    box-sizing: border-box;
}

.sidebar a:hover {
    background: var(--hover-bg);
    color: #fff;
}

.sidebar a.active {
    background: var(--active-bg);
    color: #fff;
    font-weight: bold;
}

/* === Sidebar Credit === */
.sidebar-credit {
    padding: 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    border-top: 1px solid var(--credit-border-color);
}

.sidebar-credit small {
    display: block;
    opacity: 0.8;
}

/* === Sidebar Buttons === */
.close-btn {
    display: none;
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    color: var(--close-btn-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* === Content Area === */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* === Topbar === */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 {
    font-size: 1.2rem;
    margin: 0;
}

.theme-toggle,
.toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.theme-toggle:hover,
.toggle-btn:hover {
    color: var(--active-bg);
}

/* === Content Card === */
.content-body {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 6px var(--shadow-color);
    padding: 1rem;
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
    transition: box-shadow 0.3s ease;
}

.content-body:hover {
    box-shadow: 0 4px 10px var(--shadow-color);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* === Map Section === */
#map {
    width: 100%;
    height: calc(100vh - 80px);
    border-radius: 0;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

.content-body#map {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* === Form Elements === */

input,
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

input::placeholder,
select::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input:focus,
input:hover,
select:focus,
select:hover,
textarea:focus,
textarea:hover {
    border-color: var(--active-bg);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
    outline: none;
}

button {
    cursor: pointer;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    transition: background 0.3s, transform 0.2s;
}

.captcha {
    display: inline-block;
    padding: 3px 6px;
    color: red;
    background: #1e293b;
    font-family: sans-serif;
    letter-spacing: 3px;
    text-shadow: 1px 1px #fff;
    user-select: none;
}

/* Toast container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast base style */
.toast {
    display: flex;
    flex-direction: column;
    background-color: #2b2b2b;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.3s ease;
}

/* Message text */
.toast-message {
    font-size: 14px;
    margin-bottom: 4px;
}

/* Timestamp style */
.toast-time {
    font-size: 12px;
    color: #bbb;
    text-align: right;
    font-style: italic;
}

/* Toast types */
.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

/* Other */

.bg-blue {
    background: #2563eb;
}

.bg-blue:hover {
    background: #1d4ed8;
}

.bg-blue:active {
    background: #1e40af;
    transform: translateY(0);
}

.bg-green {
    background: #28a745;
}

.text-white {
    color: #fff;
}

.text-green {
    color: #28a745;
}

.bold {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
    color: var(--text-color);
}

.cursor-pointer {
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* === Responsive Behavior === */
@media (max-width: 640px) {
    .dashboard-wrapper {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        transition: left 0.3s ease;
        z-index: 10;
    }

    .sidebar.show {
        left: 0;
    }

    .close-btn {
        display: block;
    }

    .toggle-btn {
        display: inline;
    }

    .content-body {
        margin: 1rem;
        border-radius: 8px;
    }
}
