/* ============================================
   ESTILOS PRINCIPAIS DO SITE
   ============================================ */

/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #F8F8FF; /* Ghost White */
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #4169E1; /* Royal Blue */
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #4169E1;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #3151b3;
}

/* ============================================
   HEADER E NAVEGAÇÃO
   ============================================ */

.site-header {
    background-color: #4169E1; /* Royal Blue */
    color: white;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 50px;
    max-width: 200px;
    object-fit: contain;
    transition: height 0.3s;
}

.site-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Menu Principal */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #F8F8FF;
}

.nav-menu a i {
    font-size: 1.2rem;
}

/* Menu Mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s;
}

.mobile-menu-btn.active {
    transform: rotate(90deg);
}

/* Menu Mobile Aberto */
.nav-menu.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #4169E1;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

/* ============================================
   SEÇÕES DO SITE
   ============================================ */

.section {
    padding: 100px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.section:nth-child(even) {
    background-color: rgba(65, 105, 225, 0.05);
}

.section h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #4169E1;
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
}

.section-image {
    margin: 2rem 0;
    text-align: center;
}

.section-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Seção Hero/Hero Section */
.hero-section {
    background: linear-gradient(135deg, #4169E1 0%, #3151b3 100%);
    color: white;
    text-align: center;
}

.hero-section h1 {
    color: white;
    font-size: 3rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Serviços */
.servicos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.servico {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.servico:hover {
    transform: translateY(-5px);
}

.servico h3 {
    color: #4169E1;
    margin-bottom: 1rem;
}

/* ============================================
   FORMULÁRIO DE CONTATO
   ============================================ */

#contato {
    background-color: white;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4169E1;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Erros de formulário */
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

/* Mensagens do formulário */
.form-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-links a:hover {
    color: #4169E1;
}

.copyright {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #95a5a6;
    font-size: 0.9rem;
}

/* ============================================
   ÁREA DE LOGIN
   ============================================ */

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4169E1, #F8F8FF);
    padding: 20px;
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    color: #4169E1;
    margin-bottom: 1.5rem;
}

/* ============================================
   ÁREA ADMINISTRATIVA
   ============================================ */

.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

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

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

.admin-menu li {
    margin-bottom: 2px;
}

.admin-menu a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 12px 20px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: #34495e;
    border-left-color: #4169E1;
}

.admin-menu i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

/* Header Admin */
.admin-header {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-info {
    color: #666;
}

.user-info a {
    color: #4169E1;
    margin-left: 15px;
}

/* Conteúdo Admin */
.admin-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

/* Cards do Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: #4169E1;
    margin-bottom: 10px;
}

.card p {
    color: #666;
    margin-bottom: 20px;
}

/* Tabelas Administrativas */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.data-table th {
    background-color: #4169E1;
    color: white;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background-color: #3151b3;
}

.data-table th.sortable::after {
    content: '↕';
    margin-left: 8px;
    opacity: 0.5;
    font-size: 0.9em;
}

.data-table th.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

.data-table th.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

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

/* Formulários Admin */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Mensagens Admin */
.admin-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    position: relative;
}

.admin-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.admin-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   COMPONENTES JS
   ============================================ */

/* Botão Voltar ao Topo */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #4169E1;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: #3151b3;
    transform: translateY(-3px);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

#lightbox-caption {
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 1.1rem;
    background: rgba(0,0,0,0.8);
    border-radius: 0 0 4px 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10000;
}

.lightbox-close:hover {
    color: #4169E1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 20px;
    transition: all 0.3s;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: #4169E1;
    background: rgba(0,0,0,0.8);
}

/* Animações */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Dropdowns */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
    padding: 10px 0;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #4169E1;
}

/* Modais */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* Upload com Progresso */
.progress-container {
    height: 6px;
    background: #eee;
    margin: 15px 0;
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress {
    height: 100%;
    background: linear-gradient(90deg, #4169E1, #3151b3);
    width: 0%;
    transition: width 0.3s;
    text-align: center;
    color: white;
    font-size: 0.8rem;
    line-height: 6px;
}

/* Busca administrativa */
.admin-search {
    margin-bottom: 20px;
    position: relative;
}

.admin-search input {
    width: 300px;
    max-width: 100%;
    padding: 10px 15px 10px 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.admin-search input:focus {
    outline: none;
    border-color: #4169E1;
}

.admin-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Loading */
.loading {
    cursor: wait;
}

.loading::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4169E1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Botões */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #4169E1;
    color: white;
}

.btn-primary:hover {
    background-color: #3151b3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

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

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    color: white;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 30px;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 80px 20px;
    }
    
    .servicos-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Menu Mobile */
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    /* Header */
    .site-logo {
        height: 40px;
    }
    
    /* Seções */
    .section {
        padding: 60px 20px;
        min-height: auto;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    /* Admin */
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .admin-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .admin-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
    }
    
    .admin-menu ul {
        display: flex;
        gap: 10px;
    }
    
    .admin-menu li {
        margin-bottom: 0;
    }
    
    .admin-menu a {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .admin-menu a:hover,
    .admin-menu a.active {
        border-left: none;
        border-bottom-color: #4169E1;
    }
    
    /* Cards */
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    /* Tabelas */
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    /* Formulários */
    .form-container {
        padding: 20px;
    }
    
    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 10px;
    }
    
    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 15px;
    }
    
    /* Botão Voltar ao Topo */
    #back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
    
    /* Modal */
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    /* Busca */
    .admin-search input {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .login-container {
        padding: 2rem;
    }
    
    .section {
        padding: 50px 15px;
    }
    
    .admin-content {
        padding: 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Impressão */
@media print {
    .site-header,
    .site-footer,
    .mobile-menu-btn,
    #back-to-top,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        padding: 20px 0;
        min-height: auto;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Modo Escuro (opcional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .section:nth-child(even) {
        background-color: rgba(255, 255, 255, 0.05);
    }
    
    .servico,
    .card,
    .form-container,
    .table-container {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .form-group label {
        color: #e0e0e0;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        background-color: #2d2d2d;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .data-table {
        background-color: #1e1e1e;
    }
    
    .data-table th,
    .data-table td {
        border-color: #444;
        color: #e0e0e0;
    }
    
    .data-table tr:nth-child(even) {
        background-color: #252525;
    }
    
    .data-table tr:hover {
        background-color: #2d2d2d;
    }
}

/* Suporte a browsers antigos */
@supports not (display: grid) {
    .servicos-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .servico {
        flex: 1 0 300px;
    }
    
    .dashboard-cards {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .card {
        flex: 1 0 250px;
    }
}