/* Theme Variables */
:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-accent: #e9ecef;
    --bg-sidebar: #ffffff;
    --bg-header: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-sidebar: #333333;
    --border-color: #e0e0e0;
    --hover-bg: #f0f0f0;
    --table-header-bg: #f8f9fa;
    --table-header-text: #333333;
    --table-row-hover: #f5f5f5;
    --input-bg: #ffffff;
    --input-border: #cccccc;
    --btn-primary-bg: #007bff;
    --btn-secondary-bg: #6c757d;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-accent: #1e2a4a;
    --bg-sidebar: #0d1117;
    --bg-header: #161b22;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-sidebar: #ffffff;
    --border-color: #30363d;
    --hover-bg: #21262d;
    --table-header-bg: #21262d;
    --table-header-text: #ffffff;
    --table-row-hover: #2d333b;
    --input-bg: #0d1117;
    --input-border: #30363d;
    --btn-primary-bg: #238636;
    --btn-secondary-bg: #6e7681;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

:root[data-theme="space"] {
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --bg-accent: #1a365d;
    --bg-sidebar: linear-gradient(180deg, #0a192f 0%, #112240 100%);
    --bg-header: linear-gradient(90deg, #0a192f 0%, #112240 100%);
    --text-primary: #e6f1ff;
    --text-secondary: #8892b0;
    --text-sidebar: #e6f1ff;
    --border-color: #233554;
    --hover-bg: #233554;
    --table-header-bg: #112240;
    --table-header-text: #e6f1ff;
    --table-row-hover: #1a365d;
    --input-bg: #0a192f;
    --input-border: #233554;
    --btn-primary-bg: #64ffda;
    --btn-secondary-bg: #8892b0;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

:root[data-theme="law"] {
    --bg-primary: #f8f5f0;
    --bg-secondary: #ffffff;
    --bg-accent: #f3efe9;
    --bg-sidebar: #2c3e50;
    --bg-header: #34495e;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-sidebar: #ffffff;
    --border-color: #bdc3c7;
    --hover-bg: #ecf0f1;
    --table-header-bg: #34495e;
    --table-header-text: #ffffff;
    --table-row-hover: #f5f5f5;
    --input-bg: #ffffff;
    --input-border: #bdc3c7;
    --btn-primary-bg: #2c3e50;
    --btn-secondary-bg: #7f8c8d;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Theme Selector Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

.modal-content {
    background: var(--bg-primary);
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.theme-selector {
    padding: 20px;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-modal:hover {
    color: var(--text-primary);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theme-option {
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.theme-option:hover {
    transform: translateY(-2px);
}

.theme-preview {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid var(--border-color);
}

.preview-header {
    height: 30%;
    width: 100%;
}

.preview-content {
    height: 70%;
    width: 100%;
}

/* Theme Preview Styles */
.light-theme .preview-header { background: #f8f9fa; }
.light-theme .preview-content { background: #ffffff; }

.dark-theme .preview-header { background: #161b22; }
.dark-theme .preview-content { background: #0d1117; }

.space-theme .preview-header { 
    background: linear-gradient(90deg, #0a192f 0%, #112240 100%);
}
.space-theme .preview-content { background: #0a192f; }

.law-theme .preview-header { background: #34495e; }
.law-theme .preview-content { background: #f8f5f0; }

/* Sidebar */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    background: var(--bg-sidebar);
    left: 0;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px var(--shadow-color);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-logo {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-logo {
    padding: 10px;
    justify-content: center;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu ul li {
    margin: 5px 0;
}

.sidebar-menu ul li a {
    text-decoration: none;
    color: var(--text-sidebar);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    border-radius: 8px;
    margin: 0 10px;
}

.sidebar-menu ul li a:hover {
    background-color: var(--hover-bg);
}

.sidebar-menu ul li a i {
    min-width: 30px;
    font-size: 18px;
    text-align: center;
}

.sidebar-menu ul li a .menu-text {
    margin-left: 10px;
    opacity: 1;
    transition: opacity 0.3s;
}

.sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background-color: var(--bg-primary);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    background: var(--btn-primary-bg);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-options {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .theme-options {
        grid-template-columns: 1fr;
    }
    
    .task-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-responsive {
        margin: 10px -15px;
        width: calc(100% + 30px);
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Table Styles */
.unified-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    background: var(--bg-secondary);
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.unified-table th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    padding: 1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.unified-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.unified-table tr:last-child td {
    border-bottom: none;
}

.unified-table tr:hover td {
    background-color: var(--table-row-hover);
}

/* Badges de status */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.status-ativo {
    background-color: rgba(28, 194, 138, 0.15);
    color: var(--status-completed-text);
}

.status-inativo {
    background-color: rgba(231, 74, 59, 0.15);
    color: var(--status-late-text);
}

@media (max-width: 768px) {
    .unified-table td,
    .unified-table th {
        padding: 0.75rem;
    }
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: all 0.3s ease;
    margin: 10px 0;
}

.sidebar.collapsed .logo-img {
    width: 40px;
    height: 40px;
    margin: 5px 0;
}

/* Rest of your existing styles... */

/* Estilos específicos para a página de login */
.login-body {
    background-color: #1a1a2e; /* Cor de fundo escura */
    color: #ffffff; /* Texto claro para contraste */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-wrapper {
    width: 100%;
    padding: 20px;
}

.login-card {
    background-color: var(--bg-primary);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out, pulseLogo 3s infinite alternate;
}

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

@keyframes pulseLogo {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.login-header {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    padding: 2rem 0;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.login-header h2 {
    margin-top: 0;
    font-size: 1.75rem;
}

.login-form-container {
    padding: 20px;
}

.login-form-container .input-group {
    margin-bottom: 1.5rem;
}

.login-form-container label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: bold;
}

.login-form-container .form-control {
    border: 1px solid var(--input-border);
    border-radius: 5px;
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.login-form-container .form-control:focus {
    border-color: var(--btn-primary-bg);
    outline: none;
    box-shadow: 0 0 0 0.1rem rgba(0,123,255,.25);
}

.login-form-container .btn-primary {
    background-color: #64ffda; /* Verde neon para tema escuro */
    color: #1a1a2e; /* Cor de texto escura para contraste */
    border: none;
    border-radius: 5px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    width: 100%;
    transition: background-color 0.3s;
}

.login-form-container .btn-primary:hover {
    background-color: #0056b3; /* Cor mais escura no hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Sombra mais forte no hover */
    transform: translateY(-1px); /* Leve elevação no hover */
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.login-footer {
    text-align: center;
    padding: 1rem 0;
    background-color: var(--bg-accent);
    border-top: 1px solid var(--border-color);
}

.login-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--btn-primary-bg);
}

/* Animação de carregamento (opcional, se desejar adicionar) */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--btn-primary-bg);
    border-top-color: transparent;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Ajustes para ícones nos inputs */
.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 35px; /* Ajuste para alinhar verticalmente */
    transform: translateY(0%); /* Removido o translateY */
    color: var(--text-secondary);
}

.input-group input {
    padding-left: 40px; /* Espaço para o ícone */
}

/* Mensagem de erro */
.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

/* Adaptações para telas menores (opcional, dependendo do design) */
@media (max-width: 576px) {
    .login-card {
        max-width: 95%;
    }
    .login-header {
        padding: 1.5rem 0;
    }
    .login-header h2 {
        font-size: 1.5rem;
    }
    .login-form-container {
        padding: 15px;
    }
    .login-footer {
        padding: 0.75rem 0;
    }
}

/* Fim dos estilos de login */
