/* Custom Styles for TurfBooking - Dark Theme */

/* Color Variables */
:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --card-bg: #1e1e1e;
    --hover-bg: #2a2a2a;
    --border-color: #333333;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    --accent-gradient: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
    --danger: #ff4757;
    --warning: #ffa502;
    --success: #26de81;
    --info: #00d4ff;
}

/* General */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    animation: pageFadeIn 220ms ease-out;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.btn,
.form-control,
.navbar,
.dropdown-menu {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    border-bottom: 2px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    opacity: 0.05;
    pointer-events: none;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.18) 1px, rgba(0,0,0,0) 1px);
    background-size: 18px 18px;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Search Bar */
.search-bar-container {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.1);
    margin-top: 30px;
}

.search-bar-container input,
.search-bar-container select {
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 15px 20px;
    text-align: center;
}

/* Ensure type select text is centered consistently */
.search-bar-container select {
    text-align-last: center;
}

/* Try to center date text in hero search bar (desktop + mobile where supported) */
.search-bar-container input[type="date"] {
    text-align: center;
}

.search-bar-container input[type="date"]::-webkit-datetime-edit,
.search-bar-container input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.search-bar-container input[type="date"]::-webkit-datetime-edit-text,
.search-bar-container input[type="date"]::-webkit-datetime-edit-month-field,
.search-bar-container input[type="date"]::-webkit-datetime-edit-day-field,
.search-bar-container input[type="date"]::-webkit-datetime-edit-year-field {
    text-align: center;
}

@media (max-width: 768px) {
    .search-bar-container .btn {
        padding: 10px 14px;
        font-size: 0.95rem;
        border-radius: 14px;
    }
    .search-bar-container .btn i {
        margin-right: 6px;
    }
}

.search-bar-container input::placeholder {
    color: var(--text-muted);
}

.search-bar-container .btn {
    background: var(--accent-gradient);
    border: none;
    color: var(--primary-bg);
    font-weight: 600;
    border-radius: 50px;
    padding: 15px 40px;
    transition: all 0.3s ease;
}

.search-bar-container .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
}

/* Turf Cards */
.turf-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
}

.turf-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.2);
}

.turf-card-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.turf-card-body {
    padding: 20px;
    background: var(--card-bg);
    color: var(--text-primary);
}

.turf-rating {
    background: var(--accent-gradient);
    color: var(--primary-bg);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.turf-price {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Turf card footer: keep price and Book Now button in one row */
.turf-card-footer-row {
	flex-wrap: nowrap;
	align-items: center;
	gap: 10px;
}

.turf-card-footer-row .turf-price {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1.2rem;
}

.turf-card-footer-row .btn {
	flex-shrink: 0;
	white-space: nowrap;
}

.wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.wishlist-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.wishlist-btn.active {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Featured badge on turf cards */
.turf-featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Filters */
.filter-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.filter-chip {
    display: inline-block;
    padding: 8px 15px;
    margin: 5px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.filter-chip.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: var(--primary-bg);
    font-weight: 600;
}

/* Time Slots */
.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.time-slot {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.time-slot:hover {
    border-color: var(--accent-primary);
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.time-slot.selected {
    border-color: transparent;
    background: var(--accent-gradient);
    color: var(--primary-bg);
    font-weight: 600;
}

.time-slot.booked {
    background: var(--secondary-bg);
    border-color: var(--text-muted);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Public booking slots should remain clickable even if booked */
.time-slot.booked.public-joinable {
    cursor: pointer;
    opacity: 0.9;
    border-color: var(--accent-secondary);
}

/* Public booking availability color rules */
.time-slot.booked.public-joinable.public-available {
    border-color: var(--success);
}

.time-slot.booked.public-joinable.public-low {
    border-color: var(--warning);
}

.time-slot.booked.public-joinable.public-full {
    border-color: var(--danger);
    opacity: 0.75;
}

.time-slot.booked.public-joinable:hover {
    border-color: var(--accent-primary);
    background: var(--hover-bg);
    transform: translateY(-2px);
}

/* Public booking modal (dark theme) */
.public-booking-modal-content {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.public-booking-modal-content .modal-header {
    border-bottom: 1px solid var(--border-color);
}

.public-booking-modal-content .modal-footer {
    border-top: 1px solid var(--border-color);
}

.public-booking-modal-content .modal-body {
    color: var(--text-primary);
}

.public-booking-modal-content hr {
    border-color: var(--border-color);
    opacity: 1;
}

.public-booking-modal-content .list-group-item {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.public-booking-modal-content .text-muted {
    color: var(--text-muted) !important;
}

.time-slot.blocked {
    background: var(--secondary-bg);
    border-color: var(--danger);
    color: var(--danger);
    cursor: not-allowed;
    opacity: 0.5;
}

.time-slot.past {
    background: var(--secondary-bg);
    border-color: var(--text-muted);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.4;
}

.time-slot.past:hover {
    transform: none;
    border-color: var(--text-muted);
    background: var(--secondary-bg);
}

/* Booking Summary */
.booking-summary {
    position: sticky;
    top: 80px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.summary-total {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
}

.gallery-main {
    grid-row: 1 / 3;
    grid-column: 1;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Reviews */
.review-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.review-rating {
    color: var(--warning);
}

.review-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Amenities */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.amenity-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.amenity-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

/* Profile Page */
.profile-header {
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    opacity: 0.1;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid var(--accent-primary);
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Booking Status */
.status-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-confirmed {
    background: rgba(38, 222, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-cancelled {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-completed {
    background: rgba(0, 212, 255, 0.2);
    color: var(--info);
    border: 1px solid var(--info);
}

.status-pending {
    background: rgba(255, 165, 2, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .search-bar-container {
        border-radius: 15px;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: 300px;
        height: auto;
    }
    
    .gallery-main {
        grid-row: 1;
        grid-column: 1;
    }
    
    .time-slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .time-slot {
        padding: 8px 6px;
        font-size: 0.85rem;
        min-height: 60px;
        touch-action: manipulation; /* Improve touch responsiveness */
    }
    
    .time-slot:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }
    
    /* Loading spinner improvements for mobile */
    .loading-spinner {
        width: 30px;
        height: 30px;
        border: 3px solid var(--border-color);
        border-top: 3px solid var(--accent-primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    .booking-summary {
        position: static;
        margin-top: 30px;
    }
    
    .turf-card-image {
        height: 180px;
    }
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-header {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-body {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Table Styles */
.table {
    color: var(--text-primary);
}

.table thead {
    background: var(--secondary-bg);
    border-bottom: 2px solid var(--accent-primary);
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--hover-bg);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-left-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 0 10px var(--danger);
}

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

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Button Styles */
.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: var(--primary-bg);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
    color: var(--primary-bg);
}

.btn-secondary {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Form Controls */
.form-control,
.form-select {
    background: var(--secondary-bg);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    background: var(--card-bg);
    border-color: var(--accent-primary) !important;
    color: var(--text-primary);
    box-shadow: none !important; /* avoid double focus outline/glow */
    outline: none !important;
}

/* Make sure MDB form-outline inputs also respect single-border focus */
.form-outline .form-control:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: none !important;
    outline: none !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
}

/* Global checkbox styling for user portal */
.form-check-input[type="checkbox"] {
	width: 16px;
	height: 16px !important;
	min-height: 16px !important; /* override framework or inline min-height (e.g. 48px) */
	box-sizing: border-box;
	background-color: var(--secondary-bg);
	border: 2px solid var(--border-color);
	border-radius: 3px;
	padding: 0;
	display: inline-block;
	vertical-align: middle;
	-webkit-appearance: none;
	appearance: none;
	background-image: none !important;
	transform: none !important;
	line-height: 1;
	cursor: pointer;
	transition: all 0.2s ease;
}

.form-check-input[type="checkbox"]:checked {
	background-color: var(--accent-primary);
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.25);
}

.form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.25);
    outline: none;
}

.form-check-label {
    color: var(--text-secondary);
}

/* Checkout page checkbox layout and size (avoid framework classes entirely) */
.checkout-page .checkout-check-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.checkout-page .checkout-addon-checkbox {
	width: 1.1rem;
	height: 1.1rem;
	min-width: 1.1rem;
	min-height: 1.1rem;
	margin: 0;
	flex: 0 0 auto;
	vertical-align: middle;
	accent-color: var(--accent-primary);
}

.checkout-page .checkout-addon-checkbox:checked {
	background-color: var(--accent-primary);
	border-color: var(--accent-primary);
}

/* Links */
a {
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* Text Colors */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--accent-primary) !important;
}

/* Background Utilities */
.bg-dark {
    background-color: var(--card-bg) !important;
}

.bg-darker {
    background-color: var(--secondary-bg) !important;
}

/* Light background helpers: ensure readable dark text when using white/light sections */
.bg-light {
    background-color: #f8f9fa !important;
    color: #222 !important;
}

.bg-light .text-muted {
    color: #555 !important;
}
