:root {
    --primary-color: #ffc107;
    --text-color: #333;
    --link-hover-color: #e0a800;
    --navbar-height: 56px;
}

.bg-primary {
    background-color: var(--primary-color) !important;
    color: #000 !important;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

.btn-warning {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bs-dark);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn-warning:hover {
    background-color: var(--link-hover-color);
    border-color: var(--link-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    color: #000 !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding-top: var(--navbar-height);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1 0 auto;
}

.content-wrapper {
    flex: 1 0 auto;
}

.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: var(--navbar-height);
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--primary-color);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    .navbar-nav {
        background-color: var(--primary-color);
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 0.375rem;
    }

    .nav-link:hover {
        background-color: var(--link-hover-color);
        transform: none;
    }
}

.navbar-brand {
    color: #212529 !important;
    font-weight: bold;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.nav-link {
    color: #212529 !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
}

.nav-link:hover {
    color: rgba(0, 0, 0, 0.7) !important;
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(33, 37, 41, 0.8) !important;
    color: white !important;
    border-radius: 0.375rem;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff;
}

.hero-section {
    position: relative;
    min-height: 600px;
    margin-top: calc(-1 * var(--navbar-height));
    background-image: url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1;
}

.hero-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    text-align: center;
    padding: 1.5rem;
    margin-top: var(--navbar-height);
    color: white;
    z-index: 2;
    border-radius: 8px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.home .hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1.5rem;
}

.hero-logo {
    display: block;
    margin: 0 auto 1.5rem;
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.home .hero-logo {
    margin: 0 1.5rem 0 0;
    width: 128px;
    height: 128px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 675;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.home .hero-title {
    margin-bottom: 0;
    text-align: left;
}

.hero-subtitle {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.home .hero-subtitle {
    flex-basis: 100%;
    margin-top: 1rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.feature-card {
    height: 100%;
    transition: all 0.3s ease;
    border: none;
    background-color: var(--primary-color);
    border-radius: 10px;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature-card .card-body {
    padding: 2rem;
}

.feature-card .card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.feature-card .card-text {
    font-size: 1.1rem;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.btn-filter {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.btn-filter:hover {
    background-color: #ffca2c;
    border-color: #ffca2c;
    color: #000;
}

.form-select:focus,
.form-control:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

@media (max-width: 768px) {
    .hero-logo {
        width: 100px;
        height: 100px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
}

.card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

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

footer {
    flex-shrink: 0;
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 1rem 0;
    margin-top: 2rem;
}

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 40px;
    height: 40px;
    line-height: 40px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

#backToTop:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
}

#backToTop.show {
    opacity: 1;
}

.back-to-top {
    transition: all 0.3s ease;
    display: inline-block;
    color: #212529 !important;
}

.back-to-top:hover {
    transform: translateY(-3px);
    color: #212529 !important;
    text-decoration: underline !important;
}

.back-to-top i {
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

.preload-images {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.content-wrapper {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    will-change: opacity;
}

.content-wrapper.transitioning {
    opacity: 0;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

.filter-sidebar {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ffc107;
}

.document-icon {
    font-size: 1.2em;
}

.pdf-icon { color: #dc3545; }
.odt-icon { color: #2ecc71; }
.docx-icon { color: #0d6efd; }
.xlsx-icon { color: #1f7244; }
.ods-icon { color: #78ab63; }
.image-icon { color: #e67e22; }

.filter-icon {
    color: #ffc107;
    margin-right: 10px;
    font-size: 1.2em;
}

.form-floating {
    position: relative;
}

.form-floating > .form-control {
    padding-left: 2.5rem;
}

.form-floating > label {
    padding-left: 2.5rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-1rem) translateX(.15rem);
    background-color: white;
    height: auto;
    padding: 0 0.5rem;
    margin-left: 1.5rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    color: #ffc107;
}

.form-floating textarea.form-control ~ .input-icon {
    top: 1.625rem;
}

.card-title .fa-robot,
.card-title .fa-file-lines,
.card-title .fa-paper-plane {
    color: #ffc107;
}

.card.bg-light {
    border: 2px solid #ffc107;
    background-color: #fff9e6 !important;
}

.card.bg-light .card-title {
    color: #000;
    margin-bottom: 1rem;
}

.form-control:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

.was-validated .form-control:valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
}

.page-loading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 9999;
    transition: width 0.2s ease-in-out;
    opacity: 0;
}

body.page-loading .page-loading-progress {
    opacity: 1;
    animation: progress-animation 2s ease-in-out forwards;
}

@keyframes progress-animation {
    0% { width: 0%; }
    20% { width: 40%; }
    50% { width: 60%; }
    80% { width: 80%; }
    90% { width: 90%; }
    100% { width: 100%; }
}

select option[disabled] {
    background-color: #e9ecef;
    color: #6c757d;
    border-bottom: 1px solid #ced4da;
    border-top: 1px solid #ced4da;
    padding: 2px 0;
    margin: 4px 0;
    font-size: 0.8em;
    text-align: center;
}

.dropdown .btn-outline-primary {
    border: 1px solid #ced4da;
    color: #212529;
    background-color: #fff;
    box-shadow: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dropdown .btn-outline-primary:hover {
    border-color: #ced4da;
    background-color: #fff;
}

.dropdown .btn-outline-primary:focus,
.dropdown .btn-outline-primary.show {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
    background-color: #fff;
}

.dropdown-menu {
    border: 1px solid #ced4da;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
}

.dropdown-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: #fff;
}

.dropdown-item:hover {
    background-color: var(--primary-color) !important;
    color: #212529;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color) !important;
    color: #000;
}

.dropdown-divider {
    margin: 0.25rem 0;
    border-top: 1px solid #e9ecef;
}

.dropdown-item.active, 
.dropdown-item:active {
    background-color: var(--primary-color);
    color: #000;
}

#dropdownFileType, #dropdownYear {
    height: 38px;
}

        .input-group-icon {
            position: relative;
            margin-bottom: 1.5rem;
        }
        
        .input-icon-wrapper {
            position: absolute;
            left: -15px;
            top: 50%;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            background-color: var(--primary-color);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #212529;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            z-index: 5;
        }
        
        .input-group-icon .form-floating {
            width: 100%;
            padding-left: 15px;
        }
        
        .textarea-icon-wrapper {
            top: 30px;
        }
        
        .captcha-wrapper {
            position: relative;
            padding-left: 30px;
        }
        
        .captcha-icon-wrapper {
            position: absolute;
            left: -15px;
            top: 50%;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            background-color: var(--primary-color);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #212529;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            z-index: 5;
        }
        
        .form-floating textarea.form-control {
            height: 150px;
        }

.input-group-icon {
    position: relative;
    margin-bottom: 1.5rem;
}