/* Variables - Light Theme */
.light-theme { /*:root*/
    /* Light Theme Colors */
    --theme-bg: #f5f5f5;
    --theme-surface: #ffffff;
    --theme-border: #dee2e6;
    --theme-text: #212529;
    --theme-text-secondary: #6c757d;
    --theme-primary: #007bff;
    --theme-primary-hover: #0056b3;
    --theme-danger: #dc3545;
    --theme-danger-hover: #c82333;
    --theme-success: #28a745;
    --theme-success-hover: #218838;
    --theme-info: #17a2b8;
    --theme-info-hover: #138496;
    --theme-warning: #ffc107;
    --theme-warning-hover: #e0a800;
    --theme-shadow: rgba(0, 0, 0, 0.1);
    --theme-bg-textbox: #fff;
    --theme-header-bg:#ccc;
}

/* Variables - Dark Theme */
.dark-theme, [data-theme='dark'] {
    --theme-bg: #1a1a1a;
    --theme-surface: #2d2d2d;
    --theme-border: #404040;
    --theme-text: #e0e0e0;
    --theme-text-secondary: #a0a0a0;
    --theme-primary: #3982e4;
    --theme-primary-hover: #2d6ec0;
    --theme-danger: #dc3545;
    --theme-danger-hover: #bb2d3b;
    --theme-success: #28a745;
    --theme-success-hover: #218838;
    --theme-info: #17a2b8;
    --theme-info-hover: #138496;
    --theme-warning: #ffc107;
    --theme-warning-hover: #e0a800;
    --theme-shadow: rgba(0, 0, 0, 0.3);
    --theme-bg-textbox: #444;
    --theme-header-bg: #666;
}

/* Global Styles */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--theme-bg);
    color: var(--theme-text);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}
.main {    
    background-color: var(--theme-bg);
    color: var(--theme-text);    
    transition: background-color 0.3s, color 0.3s;
    position:absolute;
    left:0;
    right:0;
    top:0;
    bottom:0;
}
header {
    padding: 2rem;
    padding-bottom: 0;
    background-color: var(--theme-header-bg);
}

/* Layout */
.container {
    padding: 2rem;
    padding-top:0px;
    max-width: 100%;
    margin: 0 auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col {
    flex: 1;
    padding: 0.5rem;
}
 /* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--theme-bg);
}

.login-box {
    background: var(--theme-surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--theme-shadow); /* 0 0 10px rgba(0,0,0,0.1); */
    width: 100%;
    max-width: 400px;
    border-color:var(--theme-border);
}

.form-group {
    margin-bottom: 1rem;
}
.input-icon {
    float: left;
    margin-left: 12px;
    margin-top: -28px;
    position: relative;
    z-index: 2;
}
.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    margin-top: 0.25rem;
    box-sizing: border-box;
    color: var(--theme-color);
}
.form-control.icon {
    padding-left:35px;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

    .btn-primary:hover {
        background-color: #0056b3;
    }

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--theme-text);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Links */
a {
    color: var(--theme-primary);
    text-decoration: none;
    transition: color 0.2s;
}

    a:hover {
        color: var(--theme-primary-hover);
        text-decoration: underline;
    }

/* Buttons */
.button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: var(--theme-surface);
    color: var(--theme-text);
}

.button.icon {
    padding: 0.8rem 1rem;    
}
    .button.icon-small {
        padding: 0.5rem;
    }

    .button:hover {
        background-color: var(--theme-border);
    }

.button-primary {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

    .button-primary:hover {
        background-color: var(--theme-primary-hover);
        border-color: var(--theme-primary-hover);
    }

.button-danger {
    background-color: var(--theme-danger);
    border-color: var(--theme-danger);
    color: white;
}

    .button-danger:hover {
        background-color: var(--theme-danger-hover);
        border-color: var(--theme-danger-hover);
    }

.button-success {
    background-color: var(--theme-success);
    border-color: var(--theme-success);
    color: white;
}

    .button-success:hover {
        background-color: var(--theme-success-hover);
        border-color: var(--theme-success-hover);
    }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--theme-text);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    background-color: var(--theme-bg-textbox);
    color: var(--theme-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .form-control:focus {
        border-color: var(--theme-primary);
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

/* Tables */
.table {
    margin-top:1rem;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: var(--theme-surface);
}

    .table th,
    .table td {
        padding: 0.75rem;
        border: 1px solid var(--theme-border);
    }

    .table th {
        background-color: var(--theme-surface);
        font-weight: 600;
    }

    .table tr:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }

[data-theme='dark'] .table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Cards */
.card {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px var(--theme-shadow);
}

.card-header {
    padding: 0.75rem 1rem;
    margin: -1rem -1rem 1rem -1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--theme-border);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: var(--theme-success);
    color: var(--theme-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: var(--theme-info);
    color: var(--theme-info);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: var(--theme-warning);
    color: var(--theme-warning);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: var(--theme-success);
    color: white;
}

.badge-danger {
    background-color: var(--theme-danger);
    color: white;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--theme-surface);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px var(--theme-shadow);
    max-width: 500px;
    width: 90%;
}

/* Validation */
.validation-message {
    color: var(--theme-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--theme-success);
}

.invalid {
    outline: 1px solid var(--theme-danger);
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid var(--theme-border);
    border-top: 4px solid var(--theme-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.font-medium {
    font-weight:bold;
}
.cursor-pointer {
    cursor:pointer;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

/* Debug Mode Toggle */
.debug-mode-toggle {
    position: fixed;
    top: 10px;
    right: 20px;
    background-color: var(--theme-bg);
    color: var(--theme-text);
    padding: 8px;
    border-radius: 4px;
    box-shadow: var(--theme-shadow);
    z-index: 1000;
}

.select-mode {
    margin-left: 8px;
    padding: 10px;
    border-radius: 4px;
    border: var(--theme-border);
    background-color: var(--theme-bg-textbox);
    color:var(--theme-text)
}

/* Theme Switch */
.dark-mode-toggle {
    position:absolute;
}
.theme-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

/* NAV */
nav {
    position: absolute;
    left: 180px;
    top: 10px;
}
nav a {
    margin-right:20px;
    color:var(--theme-text)
}
    nav a:hover {
        color: var(--theme-text)
    }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
    }

    .table-responsive {
        overflow-x: auto;
    }
}
