/* Components CSS - Reusable UI Components */
/* Buttons, Cards, Forms, Modals, Navigation Elements */

/* ==================== BUTTONS ==================== */

/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Button variants */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
}

.btn-primary:hover {
    background-color: rgba(0, 51, 102, 0.9);
}

.btn-accent {
    background: var(--accent);
    color: var(--primary);
    padding: 0.75rem 2rem;
}

.btn-accent:hover {
    background-color: #e6c200;
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
    padding: 0.75rem 2rem;
}

.btn-outline:hover {
    background: currentColor;
    color: white;
}

/* Button sizes */
.btn-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.btn-md {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* Icon buttons */
.btn-icon {
    width: 3rem;
    height: 3rem;
    padding: 0;
}

.btn-icon i {
    margin: 0;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==================== CARDS ==================== */

/* Base card */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

/* Card variants */
.card-primary {
    background: linear-gradient(to bottom right, var(--primary), #004080);
    color: white;
}

.card-accent {
    background: linear-gradient(to bottom right, var(--accent), #e6c200);
    color: var(--primary);
}

.card-bordered {
    border: 2px solid #e5e7eb;
}

/* Card elements */
.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
}

.card-body {
    margin-bottom: 1rem;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Card icon */
.card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ==================== FORMS ==================== */

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

/* Form label */
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.form-label i {
    margin-right: 0.5rem;
    color: var(--accent);
}

/* Form input */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Form textarea */
.form-textarea {
    min-height: 8rem;
    resize: vertical;
}

/* Form select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Form validation states */
.form-input.error {
    border-color: #ef4444;
}

.form-input.success {
    border-color: #10b981;
}

.form-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==================== MODALS ==================== */

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity 0.3s ease-out;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Modal container */
.modal {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 42rem;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    max-height: 90vh;
    overflow-y: auto;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.modal-overlay.hidden .modal {
    opacity: 0;
    transform: scale(0.95);
}

/* Modal header */
.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.modal-description {
    color: #6b7280;
    line-height: 1.625;
}

/* Modal close button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    font-size: 1.5rem;
}

.modal-close:hover {
    color: #6b7280;
}

/* Modal body */
.modal-body {
    margin-bottom: 1.5rem;
}

/* Modal footer */
.modal-footer {
    text-align: center;
    padding-top: 1.5rem;
}

/* ==================== NAVIGATION ==================== */

/* Navigation bar */
.navbar {
    background: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Navbar brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.navbar-logo {
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Navbar menu */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-link {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-link:hover {
    color: var(--accent);
}

.navbar-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
}

/* Mobile menu toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==================== BADGES & TAGS ==================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-accent {
    background: var(--accent);
    color: var(--primary);
}

.badge-outline {
    background: transparent;
    border: 2px solid currentColor;
}

/* ==================== SOCIAL ICONS ==================== */

.social-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-2px);
}

.social-icons-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==================== LOADING STATES ==================== */

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

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

@media screen and (max-width: 768px) {
    .navbar-menu {
        display: none;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

@media screen and (max-width: 640px) {
    .modal {
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}
