/* ========================================
   COMPONENTS CSS - Reusable Component Styles
   ======================================== */

/* ========================================
   HOUSE COLORING SYSTEM
   ======================================== */
.house-row {
    transition: all 0.3s ease;
    position: relative;
    border-left-width: 8px !important;
    border-left-style: solid !important;
}

.house-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    z-index: 1;
}

.house-row td {
    border-color: rgba(0,0,0,0.1);
    padding: 12px 8px;
}

/* House Colors */
.house-1 {
    border-left-color: #2196f3 !important;
    background-color: #e3f2fd;
}

.house-2 {
    border-left-color: #f44336 !important;
    background-color: #ffebee;
}

.house-3 {
    border-left-color: #ff9800 !important;
    background-color: #fff3e0;
}

.house-0 {
    border-left-color: #4caf50 !important;
    background-color: #e8f5e8;
}

.house-5 {
    border-left-color: #9c27b0 !important;
    background-color: #f3e5f5;
}

.house-6 {
    border-left-color: #607d8b !important;
    background-color: #eceff1;
}

/* House Legend */
.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    display: inline-block;
}

/* ========================================
   BOOK COMPONENTS
   ======================================== */
.book-card {
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.book-table {
    margin-bottom: 0;
}

.book-table th {
    background-color: #000000;
    border-color: rgba(0,0,0,0.1);
    font-weight: 600;
    color: #ffffff;
}

.book-table td {
    border-color: rgba(0,0,0,0.1);
    vertical-align: middle;
}

.book-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.book-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.book-status {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.status-available {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-unavailable {
    background-color: #f8d7da;
    color: #721c24;
}

.borrower-info {
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.borrower-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.borrower-details {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.125rem;
}

/* ========================================
   LOGIN COMPONENTS
   ======================================== */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.login-container {
    max-width: 400px;
    margin: 50px auto;
}

/* ========================================
   FORM COMPONENTS
   ======================================== */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    z-index: 10;
}

.form-section {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

/* ========================================
   CARD COMPONENTS
   ======================================== */
.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
}

.info-card .card-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.stats-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* ========================================
   TABLE COMPONENTS
   ======================================== */
.data-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 12px 8px;
}

.data-table tbody td {
    border-color: rgba(0,0,0,0.1);
    padding: 12px 8px;
    vertical-align: middle;
}

/* ========================================
   SEARCH COMPONENTS
   ======================================== */
.search-form {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-form .form-label {
    font-weight: 600;
    color: #495057;
}

/* ========================================
   PAGINATION COMPONENTS
   ======================================== */
.pagination-info {
    background-color: #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

/* ========================================
   DEBUG COMPONENTS
   ======================================== */
.debug-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.debug-panel h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.debug-log {
    background: #343a40;
    color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    word-wrap: break-word;
}

/* ========================================
   STATUS INDICATORS
   ======================================== */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* ========================================
   LOADING COMPONENTS
   ======================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   TOOLTIP COMPONENTS
   ======================================== */
.custom-tooltip {
    position: relative;
    cursor: help;
}

.custom-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #343a40;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.custom-tooltip:hover::after {
    opacity: 1;
} 