/* Custom Styles for E-commerce Website */

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: #FFF9F9;
    color: #444444;
}

/* General styling for hero section */
.hero-section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Carousel images should cover the container */
.hero-section .carousel-item img {
    width: 100%;
    height: 80vh; /* adjust height for desktops */
    object-fit: cover;
}

/* Overlay caption styling */
.hero-section .carousel-caption {
    bottom: 20%;
    text-align: center;
}

/* Headings */
.hero-section .carousel-caption h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

/* Description */
.hero-section .carousel-caption p {
    font-size: 1.25rem;
    margin-top: 0.5rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}

/* CTA Button */
.hero-section .carousel-caption .btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
}

/* Product Cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-card .card-img-top {
     width: 100%;          /* Image always fills card width */
    height: auto;         /* Height adjusts automatically */
    max-height: 40vh;     /* Optional: limit max height to 40% of viewport */
    object-fit: contain;  /* Keeps aspect ratio without cropping */
    padding-top: 10px;
}

.product-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

/* Buttons */
.btn-primary {
    background-color: #FF6F61;
    border-color: #FF6F61;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #e55a4f;
    border-color: #e55a4f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 111, 97, 0.3);
}

/* Navbar */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #FF6F61 !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #6C63FF !important;
}

/* Forms */
.form-control:focus {
    border-color: #FF6F61;
    box-shadow: 0 0 0 0.2rem rgba(255, 111, 97, 0.25);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Footer */
footer {
    margin-top: auto;
}

/* ======================
   Responsive Adjustments
   ====================== */

/* Tablets (≤ 991px) */
@media (max-width: 991px) {
    .hero-section .carousel-item img {
        height: 60vh;
    }

    .hero-section .carousel-caption h1 {
        font-size: 2.2rem;
    }

    .hero-section .carousel-caption p {
        font-size: 1rem;
    }

    .hero-section .carousel-caption .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.5rem;
    }
}

/* Mobiles (≤ 576px) */
@media (max-width: 576px) {
    .hero-section .carousel-item img {
        height: 50vh;
    }

    .hero-section .carousel-caption {
        bottom: 15%;
        padding: 0 10px;
    }

    .hero-section .carousel-caption h1 {
        font-size: 1.5rem;
    }

    .hero-section .carousel-caption p {
        font-size: 0.9rem;
    }

    .hero-section .carousel-caption .btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-card .card-img-top {
        height: 150px;
        object-fit: contain;
    }

    /* Dashboard responsive */
    .sidebar-toggle {
        top: 20px;
        left: 20px;
        background: linear-gradient(135deg, #FF6F61, #6C63FF);
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
    }

    .sidebar-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    }

    .sidebar-toggle i {
        font-size: 1.5rem;
    }

    /* On mobile, sidebar overlays, no margin push */
    .sidebar.show ~ .main-content {
        margin-left: 0;
    }

    /* Ensure dashboard cards are full width and stack vertically */
    .dashboard-container .row .col-md-4,
    .dashboard-container .row .col-md-6,
    .dashboard-container .row .col-md-12 {
        width: 100%;
        margin-bottom: 20px;
    }

    .dashboard-card {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Adjust chart containers for mobile */
    .chart-container {
        height: 250px;
    }

    /* Increase padding for mobile readability */
    .main-content .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .dashboard-card .card-body {
        padding: 20px;
    }

    /* Ensure navbar doesn't overlap */
    .navbar {
        position: relative;
        z-index: 1030;
    }
}


/* Admin Panel Styles */
.admin-sidebar {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.admin-content {
    padding: 20px;
}

/* Admin Table Styles */
.admin-content table {
    width: 100%;
    border-collapse: collapse;
}

.admin-content th, .admin-content td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.admin-content tr:hover {
    background-color: #f9f9f9;
}

.admin-content .actions {
    width: 200px; /* Fixed width for actions column */
    white-space: nowrap;
}

.admin-content .actions button {
    margin-right: 5px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* About Us Section */
.py-5.bg-light {
    background-color: #FFE5E0 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #FF6F61;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e55a4f;
}

/* Utility Classes */
.text-primary-custom {
    color: #FF6F61 !important;
}

.bg-primary-custom {
    background-color: #FF6F61 !important;
}

.text-secondary-custom {
    color: #6C63FF !important;
}

.bg-secondary-custom {
    background-color: #6C63FF !important;
}

.bg-accent-custom {
    background-color: #FFE5E0 !important;
}

.shadow-custom {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
}

/* Badge colors */
.badge.bg-success {
    background-color: #6C63FF !important;
}

.badge.bg-primary {
    background-color: #FF6F61 !important;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background: linear-gradient(135deg, #FF6F61 0%, #6C63FF 100%);
    color: white;
    padding: 20px 0;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
}

.sidebar.show {
    left: 0;
}

.sidebar-toggle {
    display: block;
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1001;
    background: #FF6F61;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sidebar-toggle i {
    font-size: 1.2rem;
}

.sidebar .nav-link {
    color: white;
    padding: 15px 20px;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 5px 10px;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
}

.main-content {
    margin-left: 0;
    padding: 20px;
    background: transparent;
    transition: margin-left 0.3s ease;
}

.sidebar.show ~ .main-content {
    margin-left: 250px;
}

.dashboard-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF6F61, #6C63FF);
}

.dashboard-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, #FF6F61 0%, #6C63FF 100%);
    color: white;
    border-radius: 20px 20px 0 0 !important;
    border: none;
    padding: 20px;
}

.dashboard-card .card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.dashboard-card .card-header i {
    margin-right: 12px;
    font-size: 1.2rem;
}

.dashboard-card .card-body {
    padding: 25px;
    background: rgba(255,255,255,0.9);
}

.chart-container {
    position: relative;
    height: 300px;
    margin: auto;
    border-radius: 10px;
    overflow: hidden;
}

/* Responsive Grid for Dashboard Cards */
@media (min-width: 1200px) {
    .dashboard-container .row .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    .dashboard-container .row .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 992px) {
    .dashboard-container .row .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    .dashboard-container .row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .dashboard-container .row .col-md-4,
    .dashboard-container .row .col-md-6,
    .dashboard-container .row .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }

    .dashboard-card {
        margin-bottom: 20px;
    }

    .chart-container {
        height: 250px;
    }

    .main-content .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sidebar-toggle {
        top: 20px;
        left: 20px;
        background: linear-gradient(135deg, #FF6F61, #6C63FF);
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
    }

    .sidebar-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    }

    .sidebar-toggle i {
        font-size: 1.5rem;
    }
}

/* Enhanced Table Styles for Dashboard */
.dashboard-card table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dashboard-card th {
    background: linear-gradient(135deg, #FF6F61, #6C63FF);
    color: white;
    font-weight: 600;
    padding: 15px;
    border: none;
}

.dashboard-card td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.3s ease;
}

.dashboard-card tr:hover td {
    background: rgba(255, 111, 97, 0.05);
}

/* Welcome Message Enhancement */
.main-content h1 {
    background: linear-gradient(135deg, #FF6F61, #6C63FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.5rem;
}

@media (max-width: 768px) {
    .main-content h1 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
}

/* Genealogy Page Styles */
.genealogy-container .nav-tabs {
    border-bottom: none;
    background: linear-gradient(135deg, #FFE5E0 0%, #E0F7FF 100%);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.genealogy-container .nav-tabs .nav-link {
    color: #FF6F61;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    margin: 0 5px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.genealogy-container .nav-tabs .nav-link:hover {
    background: linear-gradient(135deg, #FF6F61 0%, #6C63FF 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 111, 97, 0.3);
}

.genealogy-container .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #FF6F61 0%, #6C63FF 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(255, 111, 97, 0.3);
}

.genealogy-container .card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #FF6F61, #6C63FF) 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.genealogy-container .table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.genealogy-container .table thead th {
    background: linear-gradient(135deg, #FF6F61 0%, #6C63FF 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px;
    text-align: center;
}

.genealogy-container .table tbody tr:nth-child(even) {
    background: rgba(255, 111, 97, 0.05);
}

.genealogy-container .table tbody tr:nth-child(odd) {
    background: rgba(108, 99, 255, 0.05);
}

.genealogy-container .table tbody tr:hover {
    background: linear-gradient(135deg, rgba(255, 111, 97, 0.1) 0%, rgba(108, 99, 255, 0.1) 100%);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.genealogy-container .table td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    text-align: center;
    vertical-align: middle;
}

.genealogy-container .table td:first-child {
    font-weight: bold;
    color: #FF6F61;
}

.genealogy-container .table td:nth-child(2) {
    color: #6C63FF;
}

.genealogy-container .table td:nth-child(3) {
    color: #28a745;
}

.genealogy-container .table td:nth-child(4) {
    color: #ffc107;
}

.genealogy-container .table td:nth-child(5) {
    color: #dc3545;
}

.genealogy-container .table td:nth-child(6) {
    color: #17a2b8;
}

.genealogy-container .table td:nth-child(7) {
    color: #6f42c1;
}

.genealogy-container .tab-pane p {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: rgba(255, 111, 97, 0.1);
    border-radius: 10px;
    margin: 20px 0;
}
