/* ============================================
   Conversor de Unidades - Custom Styles
   Category: Geradores (#c0392b - Dark Red)
   Author: CalcTools - Mayarog Technology
   ============================================ */

/* ========== Category Icon Animation ========== */
.calculator-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ========== Category Grid Buttons ========== */
.category-btn {
    width: 100%;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.1) 0%, rgba(192, 57, 43, 0.05) 100%);
    border: 2px solid rgba(192, 57, 43, 0.3);
    border-radius: 15px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.category-btn i {
    font-size: 2rem;
    color: #c0392b;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.2) 0%, rgba(192, 57, 43, 0.1) 100%);
    border-color: #c0392b;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(192, 57, 43, 0.3);
}

.category-btn:hover i {
    color: #e74c3c;
    transform: scale(1.1);
}

.category-btn.active {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: #e74c3c;
    box-shadow: 0 8px 20px rgba(192, 57, 43, 0.4);
}

.category-btn.active i {
    color: #fff;
}

/* ========== Form Controls ========== */
.form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(192, 57, 43, 0.3);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #c0392b;
    box-shadow: 0 0 0 0.25rem rgba(192, 57, 43, 0.25);
    color: #fff;
}

.form-select option {
    background-color: #1a1a2e;
    color: #fff;
}

.form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(192, 57, 43, 0.3);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #c0392b;
    box-shadow: 0 0 0 0.25rem rgba(192, 57, 43, 0.25);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-group-text {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border: 2px solid #c0392b;
    color: #fff;
    font-weight: 700;
    min-width: 60px;
    justify-content: center;
    border-radius: 0 10px 10px 0;
}

/* ========== Swap Button ========== */
.btn-swap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #c0392b;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.2) 0%, rgba(192, 57, 43, 0.1) 100%);
    color: #c0392b;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-bottom: 2.5rem;
}

.btn-swap:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: #e74c3c;
    color: #fff;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(192, 57, 43, 0.4);
}

.btn-swap:active {
    transform: rotate(180deg) scale(0.95);
}

/* ========== Result Input ========== */
.result-input {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.1) 0%, rgba(192, 57, 43, 0.05) 100%);
    border: 2px solid #c0392b;
    color: #e74c3c;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    cursor: default;
}

.result-input:focus {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.15) 0%, rgba(192, 57, 43, 0.08) 100%);
    border-color: #e74c3c;
    box-shadow: 0 0 20px rgba(192, 57, 43, 0.3);
}

/* ========== Quick Results ========== */
.quick-results {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.05) 0%, rgba(192, 57, 43, 0.02) 100%);
    border: 1px solid rgba(192, 57, 43, 0.2);
    border-radius: 15px;
    min-height: 80px;
    display: none;
}

.quick-results.active {
    display: block;
}

.quick-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #c0392b;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.quick-result-item:hover {
    background: rgba(192, 57, 43, 0.1);
    transform: translateX(5px);
}

.quick-result-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.quick-result-value {
    color: #e74c3c;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ========== Conversion Table ========== */
.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.table thead th {
    color: #fff;
    font-weight: 700;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(192, 57, 43, 0.1);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(192, 57, 43, 0.2);
}

.table tbody td:first-child {
    font-weight: 600;
    color: #c0392b;
}

.table tbody td:last-child {
    font-weight: 700;
    color: #e74c3c;
    font-size: 1.1rem;
}

/* ========== Card Styles ========== */
.card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(26, 26, 46, 0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
}

.card-header {
    border-bottom: 2px solid rgba(192, 57, 43, 0.3);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 2rem;
}

/* ========== FAQ Accordion ========== */
.accordion-item {
    background-color: transparent;
    border: 1px solid rgba(192, 57, 43, 0.2);
    margin-bottom: 0.5rem;
    border-radius: 10px;
    overflow: hidden;
}

.accordion-button {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.1) 0%, rgba(192, 57, 43, 0.05) 100%);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    color: #fff;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(192, 57, 43, 0.25);
    border-color: #c0392b;
}

.accordion-button::after {
    filter: brightness(0) invert(1);
}

.accordion-body {
    background-color: rgba(26, 26, 46, 0.5);
    color: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
}

.accordion-body ul,
.accordion-body ol {
    margin-bottom: 1rem;
}

.accordion-body ul li,
.accordion-body ol li {
    margin-bottom: 0.5rem;
}

.accordion-body strong {
    color: #e74c3c;
}

/* ========== Buttons ========== */
.btn-outline-secondary {
    border-width: 2px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

/* ========== Labels ========== */
.form-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: #c0392b;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .calculator-icon i {
        font-size: 3rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .category-btn {
        padding: 1rem 0.75rem;
    }
    
    .category-btn i {
        font-size: 1.5rem;
    }
    
    .btn-swap {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    
    .form-control {
        font-size: 1rem;
    }
    
    .result-input {
        font-size: 1.25rem;
    }
    
    .input-group-text {
        min-width: 50px;
        font-size: 0.9rem;
    }
    
    .quick-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table tbody td:last-child {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .calculator-icon i {
        font-size: 2.5rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .category-btn {
        padding: 0.875rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .category-btn i {
        font-size: 1.25rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
}

/* ========== Print Styles ========== */
@media print {
    .btn-swap,
    .btn-outline-secondary,
    #categoryGrid,
    .accordion,
    #navbar-placeholder,
    #breadcrumb-placeholder,
    #footer-placeholder {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #000;
    }
    
    .card-header {
        background: #c0392b !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .table {
        color: #000;
    }
    
    .result-input {
        color: #c0392b !important;
        font-weight: 700;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quick-results.active {
    animation: fadeIn 0.4s ease-out;
}

/* ========== Scrollbar ========== */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c0392b;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #e74c3c;
}
