/**
 * Custom Styles for UCD Green Recycle Platform
 * Defines styling for homepage, booking forms, and user interface components
 */

/* ========================================
   Hero Section - Homepage Carousel
   ======================================== */

/* Base hero slide styling - full-width banner sections */
.hero-slide {
    height: 500px;              /* Fixed height for consistent layout */
    background-size: cover;     /* Cover entire container */
    background-position: center; /* Center background image */
    position: relative;         /* Allow absolute positioning of child elements */
}

/* First hero slide - green gradient background */
.hero-slide-1 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Second hero slide - teal gradient background */
.hero-slide-2 {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
}

/* Third hero slide - blue gradient background */
.hero-slide-3 {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
}

/* ========================================
   Feature Cards - Homepage Feature Section
   ======================================== */
.feature-card {
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Stats Cards */
.stats-card {
    padding: 2rem;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Product Cards */
.product-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 200px;
}

.product-info {
    background: white;
}

.product-price {
    font-size: 1.2rem;
}

/* ========================================
   Booking Steps - Multi-step Form Navigation
   ======================================== */

/* Container for step indicators */
.booking-steps {
    margin-bottom: 2rem;
}

/* Step indicator circle - shows current step in booking process */
.step-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;         /* Circular shape */
    background: #e9ecef;        /* Inactive step color */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: #6c757d;
    transition: all 0.3s;       /* Smooth transition for state changes */
}

/* Active step indicator - highlighted in green */
.step-circle.active {
    background: #28a745;        /* Green background for active step */
    color: white;
}

/* Step label text below indicator */
.step-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Progress bar container */
.step-progress {
    height: 4px;
    background: #e9ecef;        /* Background track color */
    border-radius: 2px;
    margin-top: 1rem;
    position: relative;
}

/* Progress bar fill - shows completion percentage */
.step-progress-bar {
    height: 100%;
    background: #28a745;        /* Green fill color */
    border-radius: 2px;
    transition: width 0.3s;     /* Animated width changes */
}

/* Hidden booking step sections */
.booking-step {
    display: none;              /* Hide all steps by default */
}

/* Active booking step - visible step in multi-step form */
.booking-step.active {
    display: block;             /* Show active step */
}

/* ========================================
   Category Cards - Waste Type Selection
   ======================================== */
/* Category selection cards - clickable waste type options */
.category-card {
    border: 2px solid #e9ecef;  /* Default border color */
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;            /* Indicate clickable element */
    transition: all 0.3s;       /* Smooth hover and selection transitions */
    position: relative;
}

/* Hover state - visual feedback when mouse over card */
.category-card:hover {
    border-color: #28a745;      /* Green border on hover */
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2); /* Subtle green shadow */
}

/* Selected state - applied by JavaScript when category is chosen */
.category-card.selected {
    border-color: #28a745;      /* Green border for selected card */
    background: #f8fff9;        /* Light green background */
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.category-info h6 {
    margin-bottom: 0.5rem;
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0.25rem;
}

.timeline-content {
    padding-left: 1rem;
}

/* Points Display */
.points-display {
    border-radius: 10px;
    margin: 1rem 0;
}

/* Completion Circle */
.completion-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-weight: bold;
}

.completion-number {
    font-size: 1.5rem;
}

/* ========================================
   Form Validation Styles
   ======================================== */

/* Invalid input field styling - applied by JavaScript on validation errors */
.is-invalid {
    border-color: #dc3545 !important;  /* Red border for invalid fields */
    padding-right: calc(1.5em + 0.75rem);  /* Space for error icon */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6 .4.4.4-.4m0 4.8-.4-.4-.4.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Valid input field styling - applied by JavaScript on successful validation */
.is-valid {
    border-color: #28a745 !important;  /* Green border for valid fields */
    padding-right: calc(1.5em + 0.75rem);  /* Space for success icon */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ========================================
   Dark Theme Styles
   ======================================== */

/* Dark theme variables and overrides */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --input-bg: #2d2d2d;
    --input-border: #404040;
}

/* Dark theme body and main content - body has data-theme attribute */
body[data-theme="dark"] {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
}

/* Ensure html element also has dark background */
html body[data-theme="dark"] {
    background-color: var(--bg-color) !important;
}

body[data-theme="dark"] .container,
body[data-theme="dark"] .container-fluid {
    background-color: transparent;
}

/* Apply dark background to main content areas */
body[data-theme="dark"] .bg-light,
body[data-theme="dark"] section.bg-light {
    background-color: var(--bg-secondary) !important;
    color: var(--text-color);
}

body[data-theme="dark"] .bg-white {
    background-color: var(--bg-secondary) !important;
    color: var(--text-color);
}

/* Dark theme cards */
body[data-theme="dark"] .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color) !important;
}

body[data-theme="dark"] .card-body {
    color: var(--text-color) !important;
}

body[data-theme="dark"] .card-body p,
body[data-theme="dark"] .card-body span,
body[data-theme="dark"] .card-body div,
body[data-theme="dark"] .card-body a:not(.btn) {
    color: var(--text-color) !important;
}

body[data-theme="dark"] .card-header {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color);
}

/* Dark theme form inputs */
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] textarea {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-color);
}

body[data-theme="dark"] .form-control:focus,
body[data-theme="dark"] .form-select:focus,
body[data-theme="dark"] textarea:focus {
    background-color: var(--input-bg);
    border-color: #28a745;
    color: var(--text-color);
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

body[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

/* Dark theme text colors */
body[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

body[data-theme="dark"] .text-dark {
    color: var(--text-color) !important;
}

/* Dark theme list items and text */
body[data-theme="dark"] ul,
body[data-theme="dark"] ol,
body[data-theme="dark"] li {
    color: var(--text-color) !important;
}

body[data-theme="dark"] .list-group-item {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

body[data-theme="dark"] .list-group-item:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--text-color) !important;
}

/* Dark theme tables */
body[data-theme="dark"] .table {
    color: var(--text-color) !important;
    --bs-table-bg: var(--card-bg);
    --bs-table-border-color: var(--border-color);
}

body[data-theme="dark"] .table td,
body[data-theme="dark"] .table th {
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

body[data-theme="dark"] .table thead th {
    color: var(--text-color) !important;
    background-color: var(--bg-secondary) !important;
}

body[data-theme="dark"] .table tbody td {
    color: var(--text-color) !important;
}

body[data-theme="dark"] .table td,
body[data-theme="dark"] .table th {
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

body[data-theme="dark"] .table thead th {
    color: var(--text-color) !important;
    background-color: var(--bg-secondary) !important;
}

body[data-theme="dark"] .table tbody td {
    color: var(--text-color) !important;
}

body[data-theme="dark"] .table-light {
    --bs-table-bg: var(--bg-secondary);
    color: var(--text-color) !important;
}

body[data-theme="dark"] .table-light th,
body[data-theme="dark"] .table-light td {
    color: var(--text-color) !important;
}

body[data-theme="dark"] .table-hover tbody tr:hover {
    --bs-table-accent-bg: var(--bg-secondary);
    color: var(--text-color) !important;
}

body[data-theme="dark"] .table-hover tbody tr:hover td {
    color: var(--text-color) !important;
}

/* Dark theme dropdown menus */
body[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body[data-theme="dark"] .dropdown-item {
    color: var(--text-color);
}

body[data-theme="dark"] .dropdown-item:hover,
body[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--bg-secondary);
    color: var(--text-color);
}

/* Dark theme alerts */
body[data-theme="dark"] .alert {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body[data-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.2);
    border-color: rgba(13, 202, 240, 0.5);
    color: #81d4fa;
}

body[data-theme="dark"] .alert-success {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.5);
    color: #81c784;
}

body[data-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #e57373;
}

/* Dark theme feature cards and stats */
body[data-theme="dark"] .feature-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body[data-theme="dark"] .stats-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Dark theme footer */
body[data-theme="dark"] footer.bg-dark {
    background-color: #0d0d0d !important;
}

/* Dark theme modals */
body[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body[data-theme="dark"] .modal-header {
    border-color: var(--border-color);
}

body[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

/* Dark theme pagination */
body[data-theme="dark"] .page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body[data-theme="dark"] .page-link:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-color);
}

body[data-theme="dark"] .page-item.active .page-link {
    background-color: #28a745;
    border-color: #28a745;
}

/* Dark theme badges */
body[data-theme="dark"] .badge {
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-slide {
        height: 300px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

