/* Custom Styles for Book Donation Platform */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: #667eea; /* Fallback color */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    color: white !important;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-section .lead {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-section .btn {
    animation: fadeInUp 1s ease-out 0.4s both;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 600;
}

.hero-section .btn-light {
    background-color: white;
    color: #667eea;
    border-color: white;
}

.hero-section .btn-light:hover {
    background-color: rgba(255,255,255,0.9);
    color: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.hero-section .btn-outline-light {
    background-color: transparent;
    color: white;
    border-color: white;
}

.hero-section .btn-outline-light:hover {
    background-color: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.hero-section img {
    animation: fadeInRight 1s ease-out 0.6s both;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Override Bootstrap classes that might interfere */
.hero-section.py-5 {
    background: #667eea !important; /* Fallback */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Ensure text colors are correct */
.hero-section * {
    color: inherit;
}

.hero-section .text-white {
    color: white !important;
}

.hero-section .text-white-50 {
    color: rgba(255,255,255,0.8) !important;
}

/* Button visibility fixes */
.hero-section .btn-light,
.hero-section .btn-outline-light {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hero Image Enhancements - Now using Font Awesome icons */
.hero-visual-container {
    animation: fadeInRight 1s ease-out 0.6s both;
}

.hero-visual-container:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Hero Visual Container Animations */
.hero-visual-container .book-icon-item {
    animation: floatIn 1s ease-out forwards;
    opacity: 0;
    transform: translateY(20px) rotate(0deg);
}

.hero-visual-container .book-icon-item:nth-child(1) { animation-delay: 0.1s; }
.hero-visual-container .book-icon-item:nth-child(2) { animation-delay: 0.2s; }
.hero-visual-container .book-icon-item:nth-child(3) { animation-delay: 0.3s; }
.hero-visual-container .book-icon-item:nth-child(4) { animation-delay: 0.4s; }
.hero-visual-container .book-icon-item:nth-child(5) { animation-delay: 0.5s; }
.hero-visual-container .book-icon-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes floatIn {
    to {
        opacity: 1;
        transform: translateY(0) rotate(var(--rotation, 0deg));
    }
}

.hero-visual-container .book-icon-item:hover {
    transform: translateY(-5px) rotate(0deg) scale(1.05);
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .hero-image {
        max-height: 250px !important;
        margin-top: 2rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .d-flex.gap-3 .btn {
        width: 100%;
    }

    .book-icons-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .book-icon-item {
        padding: 1rem !important;
        transform: rotate(0deg) !important;
    }
    
    .hero-visual-container {
        padding: 1.5rem !important;
        margin-top: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-image {
        max-height: 200px !important;
    }

    .book-icons-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem !important;
    }
    
    .book-icon-item {
        padding: 0.8rem !important;
    }
    
    .book-icon-item i {
        font-size: 1.5rem !important;
    }
}

/* High specificity rules to override any conflicts */
section.hero-section {
    background-color: #667eea !important;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Alternative gradient patterns for better browser support */
section.hero-section {
    background: #667eea; /* Old browsers */
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* FF3.6-15 */
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Chrome10-25,Safari5.1-6 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
}

/* Force button styling */
.hero-section .btn-light {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    color: #667eea !important;
}

.hero-section .btn-outline-light {
    background-color: transparent !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* Book Cards */
.book-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-card .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.book-card .card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.book-card .card-img-top {
    border-radius: 15px 15px 0 0;
    transition: transform 0.3s ease;
}

.book-card:hover .card-img-top {
    transform: scale(1.05);
}

.book-details p {
    margin-bottom: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.book-details strong {
    color: #495057;
}

/* Buttons */
.btn {
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(45deg, #1e7e34, #155724);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* Search and Filter Section */
.search-filter-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Badge Styles */
.badge {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(45deg, #f8d7da, #f1b0b7);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(45deg, #d1ecf1, #bee5eb);
    color: #0c5460;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Admin Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* Admin Utility Classes */
.admin-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.admin-alert {
    border: none;
    border-radius: 10px;
    border-left: 4px solid;
}

.admin-alert.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: #4CAF50;
    color: #2E7D32;
}

.admin-alert.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: #F44336;
    color: #C62828;
}

.admin-alert.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #FFC107;
    color: #F57C00;
}

.admin-alert.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-left-color: #2196F3;
    color: #1565C0;
}

/* Admin Panel Styles */
.admin-sidebar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-left-color: #3498db;
    transform: translateX(5px);
}

.admin-sidebar .nav-link.active {
    color: white;
    background-color: rgba(52, 152, 219, 0.3);
    border-left-color: #3498db;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.admin-sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Admin Main Content */
.admin-main {
    margin-left: 16.66667%; /* Same as col-md-2 */
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Admin Cards */
.admin-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.admin-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
    padding: 15px 20px;
}

.admin-card .card-body {
    padding: 20px;
}

/* Statistics Cards */
.stat-card {
    border: none;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.stat-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.stat-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.stat-card.stat-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-card.stat-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Admin Tables */
.admin-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.admin-table .table {
    margin-bottom: 0;
}

.admin-table .table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    font-weight: 600;
}

.admin-table .table tbody td {
    padding: 12px 15px;
    border-color: #e9ecef;
    vertical-align: middle;
}

.admin-table .table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Admin Buttons */
.btn-admin-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-admin-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-admin-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-admin-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
    color: white;
}

/* Admin Forms */
.admin-form .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.admin-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.admin-form .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* Responsive Admin Layout */
@media (max-width: 768px) {
    .admin-sidebar {
        position: relative;
        min-height: auto;
        width: 100%;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 15px;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .admin-table {
        font-size: 0.9rem;
    }
}

/* Admin Page Headers */
.admin-page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.admin-page-header h1 {
    margin: 0;
    font-weight: 700;
}

.admin-page-header .breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
}

.admin-page-header .breadcrumb-item {
    color: rgba(255,255,255,0.8);
}

.admin-page-header .breadcrumb-item.active {
    color: white;
}

.admin-page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.6);
}
