/**
 * Blebnen Component Library
 * Reusable UI components and patterns
 * Bootstrap 5 Compatible
 */

/* ============================================
   1. LAYOUT COMPONENTS
   ============================================ */

/* Vertical Separator Line */
#vertical-line {
    width: 1px;
    height: 42px;
    background-color: #6c757d;
    margin: auto 10px;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   2. BUTTON COMPONENTS
   ============================================ */

/* Primary Button Override */
.btn-primary {
    border-radius: 10px;
    background-color: #28a745;
    border-color: #28a745;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: #218838;
        border-color: #1e7e34;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }

.btn-secondary {
    border-radius: 10px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

/* Submit buttons */
input[type="submit"],
button[type="submit"] {
    transition: all 0.3s ease !important;
}

    input[type="submit"]:hover,
    button[type="submit"]:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
    }

/* Link Buttons */
.switch-link {
    cursor: pointer;
    margin-left: 10px;
    transition: color 0.2s ease;
}

    .switch-link:hover {
        color: #28a745;
    }

/* ============================================
   3. CARD COMPONENTS
   ============================================ */

/* Generic Card */
.listing-card {
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .listing-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    }

/* Login/Register Containers */
.login-container,
.register-container {
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

/* Image Container */
.listing-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* Description Section */
.description-section {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ============================================
   4. FORM COMPONENTS
   ============================================ */

/* Form Control Enhancements */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #28a745;
        box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25) !important;
    }

/* Input Group */
.input-group {
    margin-bottom: 1rem;
}

    .input-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #495057;
    }

/* Validation Summary */
.validation-summary ul {
    padding-left: 20px !important;
    margin-bottom: 20px !important;
}

/* ============================================
   5. NAVIGATION COMPONENTS
   ============================================ */

/* Navbar Enhancements */
.navbar-brand h1 {
    margin: 0;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    color: #495057;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
}

    .nav-link:hover,
    .nav-link.active {
        color: #28a745;
    }

/* Back to Top Button */
.back-to-top {
    right: 20px !important;
    bottom: 20px !important;
    z-index: 998 !important;
}

/* ============================================
   6. LOADING & STATE INDICATORS
   ============================================ */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ============================================
   7. UTILITY CLASSES
   ============================================ */

/* Shadow Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Text Utilities */
.text-primary {
    color: #28a745 !important;
}

/* Border Radius */
.rounded-lg {
    border-radius: 15px;
}

/* ============================================
   8. ACCESSIBILITY
   ============================================ */

/* Focus Indicators */
*:focus-visible {
    outline: 2px solid #28a745 !important;
    outline-offset: 2px !important;
}

*:focus:not(:focus-visible) {
    outline: none !important;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #28a745;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

    .skip-link:focus {
        top: 0;
    }

/* Screen Reader Only */
.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;
}

/* ============================================
   9. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Fast Rendering */
* {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch Feedback */
.active-touch {
    opacity: 0.7;
    transition: opacity 0.1s ease;
}

.mobile-device .btn:active,
.mobile-device .nav-link:active,
.mobile-device a[role="button"]:active {
    transform: scale(0.98);
}
