/**
 * Controle de Projetos - Estilo Principal
 * Design inspirado em Monday.com e Jira
 */

/* ==================== RESET E VARIÁVEIS ==================== */
:root {
    /* Paleta Modo Claro */
    --bg-body: #F4F6F8;
    --bg-header: #FFFFFF;
    --text-primary: #1C1E21;
    --text-secondary: #4E5D6C;
    --btn-primary: #C8943B;
    --btn-hover: #C8943B;
    --link-color: #4A4A4A;
    --border-color: #D0D7DE;
    --highlight: #7E57C2;
    --github-btn: #7E57C2;
    
    /* Cores Principais (legado) */
    --primary-color: #7E57C2;
    --secondary-color: #4E5D6C;
    --success-color: #00c875;
    --warning-color: #fdab3d;
    --danger-color: #e44258;
    --info-color: #C8943B;
    
    /* Cores de Fundo */
    --bg-main: var(--bg-body);
    --bg-white: var(--bg-header);
    --bg-sidebar: var(--btn-primary);
    --bg-sidebar-hover: #A57830;
    
    /* Cores de Texto */
    --text-dark: var(--text-primary);
    --text-medium: var(--text-secondary);
    --text-light: var(--text-secondary);
    --text-white: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(28, 30, 33, 0.1);
    --shadow-md: 0 4px 12px rgba(28, 30, 33, 0.15);
    --shadow-lg: 0 8px 24px rgba(28, 30, 33, 0.2);
    
    /* Medidas */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --border-radius: 8px;
    --spacing: 20px;
}

[data-theme="dark"] {
    --bg-body: #0D1117;
    --bg-header: #161B22;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --border-color: #30363D;
    --highlight: #9B6BFF;
    
    --bg-main: #0D1117;
    --bg-white: #161B22;
    --text-dark: #E6EDF3;
    --text-medium: #8B949E;
    --text-light: #8B949E;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: all 0.3s ease;
    border-radius: 0 8px 8px 0;
}

.sidebar-header {
    padding: var(--spacing);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-white);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
}

.menu-item:hover {
    background-color: var(--bg-sidebar-hover);
    border-left-color: var(--highlight);
    transform: translateX(4px);
}

.menu-item.active {
    background-color: var(--bg-sidebar-hover);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.menu-item i {
    width: 20px;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: var(--spacing);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-info i {
    font-size: 2rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.85rem;
    color: var(--text-light);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background-color: rgba(228, 66, 88, 0.2);
    color: var(--text-white);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: var(--danger-color);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--bg-main);
}

.topbar {
    background-color: var(--bg-white);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.user-welcome {
    color: var(--text-medium);
    font-size: 0.95rem;
}

.content {
    padding: 30px;
}

/* ==================== ALERTAS ==================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background-color: #d4f4dd;
    color: #00c875;
    border-left: 4px solid #00c875;
}

.alert-error {
    background-color: #ffd5dc;
    color: #e44258;
    border-left: 4px solid #e44258;
}

/* ==================== BOTÕES ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: #005bb5;
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #535465;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #00a461;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e69a2e;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #cf3449;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #3d87f5;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: 500;
}

.btn-back:hover {
    text-decoration: underline;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

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

.stat-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), #005bb5);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #00a461);
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, var(--warning-color), #e69a2e);
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, var(--info-color), #3d87f5);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-medium);
    font-size: 0.95rem;
}

/* ==================== TABELAS ==================== */
.table-container {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid #e9ecef;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.text-center {
    text-align: center;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-pendente {
    background-color: #fff3cd;
    color: #856404;
}

.badge-em-andamento {
    background-color: #cfe2ff;
    color: #084298;
}

.badge-concluído {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-cancelado {
    background-color: #f8d7da;
    color: #842029;
}

.badge-não-iniciado {
    background-color: #e9ecef;
    color: #495057;
}

.badge-bloqueado {
    background-color: #f8d7da;
    color: #842029;
}

.badge-priority-baixa {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-priority-média {
    background-color: #fff3cd;
    color: #856404;
}

.badge-priority-alta {
    background-color: #ffe5d0;
    color: #b44d12;
}

.badge-priority-urgente {
    background-color: #f8d7da;
    color: #842029;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* ==================== BARRA DE PROGRESSO ==================== */
.progress-bar {
    width: 100px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ==================== PROJETOS GRID ==================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
}

.project-header h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.project-body {
    padding: 20px;
}

.project-client {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-description {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.project-meta span {
    font-size: 0.85rem;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-progress .progress-bar {
    flex: 1;
}

.project-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==================== FORMULÁRIOS ==================== */
.form-container {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    max-width: 900px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.flex-grow {
    flex: 1;
}

/* ==================== FILTROS ==================== */
.filters-bar {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    min-width: 200px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

/* ==================== DASHBOARD SECTIONS ==================== */
.dashboard-section {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    color: var(--primary-color);
    font-size: 0.6rem;
    padding-top: 5px;
}

.activity-content p {
    margin-bottom: 5px;
    color: var(--text-dark);
}

.activity-content small {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ==================== DETALHES DO PROJETO ==================== */
.project-details {
    margin-bottom: 30px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.detail-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    color: var(--text-dark);
    font-weight: 500;
}

.detail-item span {
    color: var(--text-medium);
}

.progress-circle {
    width: 120px;
    height: 120px;
    margin: 20px auto;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) 0%, #e9ecef 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: var(--bg-white);
    border-radius: 50%;
}

.progress-value {
    position: relative;
    z-index: 1;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-item span {
    color: var(--text-medium);
    font-size: 0.85rem;
}

/* ==================== ETAPAS ==================== */
.project-stages {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.stages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stage-item {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all 0.2s ease;
}

.stage-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.stage-item.status-concluído {
    background-color: #f0f9f4;
    border-left: 4px solid var(--success-color);
}

.stage-item.status-em-andamento {
    background-color: #f0f7ff;
    border-left: 4px solid var(--primary-color);
}

.stage-item.status-bloqueado {
    background-color: #fff5f5;
    border-left: 4px solid var(--danger-color);
}

.stage-header {
    display: flex;
    gap: 15px;
    align-items: start;
}

.stage-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
}

.stage-info {
    flex: 1;
}

.stage-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stage-info p {
    color: var(--text-medium);
    font-size: 0.9rem;
}

.stage-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.stage-responsible {
    color: var(--text-medium);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stage-actions {
    display: flex;
    gap: 8px;
}

.stage-dates {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    color: var(--text-medium);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.empty-state p {
    margin-bottom: 20px;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    background: linear-gradient(135deg, var(--primary-color), #005bb5);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-medium);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--text-light);
}

.login-footer p {
    margin: 10px 0;
}

/* ==================== RESPONSIVIDADE ==================== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .btn-menu-toggle {
        display: block;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stage-header {
        flex-wrap: wrap;
    }
    
    .stage-meta {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ==================== SCROLL CUSTOMIZADO ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}
