/* Reusable component styles: buttons, badges, cards, alerts */

/* Override Bootstrap primary buttons */
.btn-primary {
    --bs-btn-bg: var(--color-red);
    --bs-btn-border-color: var(--color-red);
    --bs-btn-hover-bg: var(--color-red-dark);
    --bs-btn-hover-border-color: var(--color-red-dark);
    --bs-btn-active-bg: var(--color-red-dark);
    --bs-btn-active-border-color: var(--color-red-dark);
    background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);
    box-shadow: 0 2px 6px rgba(217, 32, 40, 0.15);
}

.btn-outline-primary {
    --bs-btn-color: var(--color-red);
    --bs-btn-border-color: var(--color-red);
    --bs-btn-hover-bg: var(--color-red);
    --bs-btn-hover-border-color: var(--color-red);
    --bs-btn-active-bg: var(--color-red);
    --bs-btn-active-border-color: var(--color-red);
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 10px;
}

/* Badges */
.badge-book {
    background-color: var(--color-red);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.badge-award {
    background-color: var(--color-blue-soft);
    color: var(--color-blue);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

/* Cards */
.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 12px;
    overflow: hidden;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(217, 32, 40, 0.1);
}

/* Alerts */
.alert-success {
    background-color: rgba(15, 138, 59, 0.1);
    border-color: var(--bs-success);
    color: var(--bs-success);
}

.alert-danger {
    background-color: rgba(200, 30, 30, 0.1);
    border-color: var(--bs-danger);
    color: var(--bs-danger);
}

.alert {
    animation: fadeInDown 0.3s ease-in-out;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: ">";
    color: var(--color-text-faint);
}

.breadcrumb-item.active {
    color: var(--color-text-soft);
}

/* Utilities */
.work-tag {
    background-color: var(--color-blue-soft);
    color: var(--color-blue);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    text-decoration: none;
}

.bg-primary-soft {
    background-color: var(--color-red-soft) !important;
}

.bg-success-soft {
    background-color: rgba(15, 138, 59, 0.1) !important;
}

.text-success {
    color: var(--bs-success) !important;
}

/* Icon circle used across pages */
.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Livre cards (used in home and CV) */
.livre-card {
    border-left: 4px solid var(--color-red);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.livre-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(217, 32, 40, 0.15) !important;
}

.livre-icon {
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.livre-cover img {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.livre-card:hover .livre-cover img {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.livre-cover .livre-icon {
    transition: transform 0.3s ease-in-out;
}

.livre-card:hover .livre-cover .livre-icon {
    transform: scale(1.05);
}

.livre-card .badge.bg-danger {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@media (max-width: 768px) {

    .livre-cover img,
    .livre-cover .livre-icon {
        width: 80px !important;
        height: 110px !important;
    }

    .livre-card .card-body {
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {

    .livre-cover img,
    .livre-cover .livre-icon {
        width: 70px !important;
        height: 95px !important;
    }

    .livre-card .d-flex {
        gap: 0.75rem !important;
    }
}

/* Form controls */
.form-control {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    height: 48px;
}

textarea.form-control {
    height: auto;
    min-height: 48px;
}

.form-control:focus {
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(217, 32, 40, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
    outline: none;
    background-color: #ffffff;
}

.form-control:hover:not(:focus) {
    border-color: #c0c7d0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #dc3545;
    font-weight: 500;
}

.form-control.is-valid,
.was-validated .form-control:valid {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
    font-style: italic;
}

/* Checkboxes/radios */
.form-check-input:checked {
    background-color: var(--color-red);
    border-color: var(--color-red);
}

.form-check-input:focus {
    border-color: var(--color-red);
    box-shadow: 0 0 0 0.2rem rgba(217, 32, 40, 0.25);
}

/* Print */
@media print {

    .navbar,
    .footer-custom,
    .btn {
        display: none !important;
    }
}