/**
 * Shared CSS - Common Styles
 * Navbar, Footer, and Utility Classes
 * Eliminates ~40% duplication across styles.css, divorcio.css, stylesCalc.css
 */

/* ============= NAVBAR STYLES ============= */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #333;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.navbar .navbar-brand img {}

.navbar .nav-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.navbar .nav-link:hover {
    color: #ffc107;
}

.navbar-collapse {
    flex-grow: 1;
}

.navbar-nav .nav-item {
    margin-right: 15px;
}

.navbar .nav-link {
    font-size: 16px;
    padding: 10px 15px;
}

.navbar-light .navbar-toggler-white {
    border-color: white;
    color: white;
}

.navbar-expand-lg {
    justify-content: space-between;
}

.navbar-expand-lg .navbar-nav .nav-link {
    padding: 10px 15px;
}

.navbar-expand-lg .navbar-nav .nav-link:hover {
    color: #ffc107;
}

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

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer p {
    margin: 0;
}

footer a {
    color: #ffc107;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ============= UTILITY CLASSES ============= */

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

.capitalize {
    text-transform: capitalize;
}

.text-uppercase {
    text-transform: uppercase;
}

.text-nowrap {
    white-space: nowrap;
}

.bold-custom-font {
    font-weight: bold;
}

.letter-spacing-custom {
    letter-spacing: 1px;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 3rem;
}

.ml-3 {
    margin-left: 1rem;
}

.ml-5 {
    margin-left: 3rem;
}

.mr-3 {
    margin-right: 1rem;
}

.w-100 {
    width: 100%;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.justify-content-center {
    justify-content: center;
}

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

/* ============= BUTTON STYLES ============= */

.btn-custom {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-custom:hover {
    background-color: #0056b3;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* ============= FORM STYLES ============= */

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.is-invalid {
    border-color: #dc3545;
}

.custom-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    margin: 0;
    opacity: 0;
}

.custom-file-label {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* ============= CARD STYLES ============= */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.text-decoration-none {
    text-decoration: none !important;
}

/* ============= RESPONSIVE UTILITIES ============= */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px 5px;
    }
    
    .navbar-nav .nav-item {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .btn-custom {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .ml-5 {
        margin-left: 0;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .navbar .navbar-brand {
        font-size: 18px;
    }
    
    .navbar .nav-link {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    footer {
        font-size: 14px;
        padding: 15px 10px;
    }
}

/* ============= ACCESSIBILITY ============= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-custom {
        border: 2px solid currentColor;
    }
    
    .card {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
