/**
 * QuickServe - Modern Glassmorphism Stylesheet
 * Service Marketplace Platform
 */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
}

/* Glassmorphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    padding: 20px 0;
    margin-bottom: 30px;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn {
    padding: 12px 25px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--success-color);
    color: white;
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Authentication Forms */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    max-width: 450px;
    width: 100%;
    padding: 40px;
    text-align: center;
}

.auth-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.auth-box p {
    margin-bottom: 30px;
    opacity: 0.9;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 3px solid #4CAF50 !important;
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 1.05rem;
    font-weight: 600 !important;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    background: #ffffff !important;
    border-color: #10b981 !important;
    color: #000000 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5) !important;
}

.form-control::placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

select.form-control {
    cursor: pointer;
    background: #ffffff !important;
    color: #111111 !important;
    font-weight: 600 !important;
}

select.form-control option {
    background: #ffffff !important;
    color: #111111 !important;
    padding: 10px !important;
}

/* Search specific overrides */
.search-input {
    background: white !important;
    color: #111 !important;
    font-weight: 600 !important;
    border: 3px solid #4CAF50 !important;
}

/* Search Bar */
.search-section {
    margin-bottom: 40px;
}

.search-box {
    padding: 30px;
    text-align: center;
}

.search-container {
    display: flex;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
}

/* Service Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.service-card {
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.5);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.service-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.service-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-color);
}

.service-category {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.service-description {
    margin-bottom: 15px;
    opacity: 0.9;
}

.service-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.service-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 25px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    opacity: 0.8;
    font-size: 1.1rem;
}

/* Table */
.table-container {
    padding: 25px;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table th {
    text-align: left;
    padding: 15px;
    font-weight: 600;
    opacity: 0.9;
}

.table td {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.15);
}

.table td:first-child {
    border-radius: 10px 0 0 10px;
}

.table td:last-child {
    border-radius: 0 10px 10px 0;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-pending {
    background: var(--warning-color);
    color: white;
}

.badge-confirmed {
    background: #3b82f6;
    color: white;
}

.badge-in_progress {
    background: #8b5cf6;
    color: white;
}

.badge-completed {
    background: var(--success-color);
    color: white;
}

.badge-cancelled {
    background: var(--danger-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 1.8rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    transform: rotate(90deg);
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success-color);
    color: #d1fae5;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger-color);
    color: #fecaca;
}

.alert-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #dbeafe;
}

/* User Cards */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.user-card {
    padding: 25px;
}

.user-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-email {
    opacity: 0.8;
    margin-bottom: 10px;
}

.user-role {
    text-transform: capitalize;
    font-weight: 500;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 20px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-container {
        flex-direction: column;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .users-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    opacity: 0.8;
}

/* --- Advanced "Hook" Animations (2026/Professional) --- */

/* 1. Text Wave Animation (Shimmering Water Effect) */
@keyframes waveShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.text-wave {
    background: linear-gradient(90deg,
            #ffffff 0%,
            #e0e0e0 20%,
            #ffffff 40%,
            #4CAF50 50%,
            #ffffff 60%,
            #e0e0e0 80%,
            #ffffff 100%);
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: waveShimmer 3s linear infinite;
    display: inline-block;
    font-weight: 800;
    /* Make it thick for better effect */
}

/* 2. Organic Logo Motion (Float + Tilt + Pulse) */
@keyframes organicFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    33% {
        transform: translateY(-3px) rotate(2deg) scale(1.02);
    }

    66% {
        transform: translateY(2px) rotate(-2deg) scale(0.98);
    }

    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

.logo-animate {
    display: inline-block;
    animation: organicFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
}

/* 3. Jelly / Bounce Button Effect */
@keyframes jelly {

    0%,
    100% {
        transform: scale(1, 1);
    }

    25% {
        transform: scale(0.9, 1.1);
    }

    50% {
        transform: scale(1.1, 0.9);
    }

    75% {
        transform: scale(0.95, 1.05);
    }
}

.btn:hover {
    animation: jelly 0.5s ease;
}

.btn:active {
    transform: scale(0.95);
    /* Tactile feedback */
    transition: transform 0.1s;
}

/* 4. Card Lift & Glow (Interactive Feel) */
.service-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(76, 175, 80, 0.4);
}

/* 5. Page Entrance Stagger */
@keyframes fadeInUpStagger {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.services-grid>div,
.portfolio-grid>div,
.table tbody tr {
    animation: fadeInUpStagger 0.6s ease-out forwards;
    opacity: 0;
    /* Star hidden */
}

.services-grid>div:nth-child(1) {
    animation-delay: 0.1s;
}

.services-grid>div:nth-child(2) {
    animation-delay: 0.2s;
}

.services-grid>div:nth-child(3) {
    animation-delay: 0.3s;
}

.services-grid>div:nth-child(4) {
    animation-delay: 0.4s;
}

.services-grid>div:nth-child(5) {
    animation-delay: 0.5s;
}

.services-grid>div:nth-child(n+6) {
    animation-delay: 0.6s;
}

.footer p {
    margin-bottom: 10px;
}

/* -----------------------------------------------------------------------------
   Professional Animations & Effects
   ----------------------------------------------------------------------------- */

/* Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Utilities */
.animate-fade {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Specific Element Animations */
.logo-animate {
    animation: spinSlow 10s linear infinite;
    display: inline-block;
}

/* Staggered animation for grids */
.services-grid>*,
.stats-grid>*,
.users-grid>* {
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.services-grid>*:nth-child(1) {
    animation-delay: 0.1s;
}

.services-grid>*:nth-child(2) {
    animation-delay: 0.2s;
}

.services-grid>*:nth-child(3) {
    animation-delay: 0.3s;
}

.services-grid>*:nth-child(4) {
    animation-delay: 0.4s;
}

.services-grid>*:nth-child(5) {
    animation-delay: 0.5s;
}

.services-grid>*:nth-child(6) {
    animation-delay: 0.6s;
}

/* Add more if needed or let them fall back to default */

/* Enhancements for existing elements */
.btn-primary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:active {
    transform: scale(0.95);
}

.service-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content {
    animation: slideUp 0.4s ease-out;
}

/* Hover effects for inputs */
.form-control:hover {
    border-color: var(--success-color) !important;
}

/* Add shine effect to primary buttons on hover */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

/* --- "Alive" UI & Micro-interactions (v1.4.0) --- */

/* 1. Chat Message Slide-Up Entrance */
@keyframes messageSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-enter {
    animation: messageSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 2. Online Status "Heartbeat" Ripple */
@keyframes ripplePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.online-ripple {
    position: relative;
}

.online-ripple::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
    animation: ripplePulse 2s infinite;
}

/* 3. "Wave" Animated Input Border on Focus */
@keyframes borderRotate {
    100% {
        background-position: 200% 0;
    }
}

.input-wave-focus:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: transparent !important;
    background-image: linear-gradient(white, white),
        linear-gradient(45deg, #4CAF50, #2196F3, #9C27B0, #4CAF50);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: borderRotate 2s linear infinite;
    background-size: 200% 200%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* 4. Status Badge "Breathe" Pulse */
@keyframes badgeBreathe {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.status-pulse {
    animation: badgeBreathe 3s ease-in-out infinite;
    display: inline-block;
    /* Required for transform */
}

/* 5. Typing Indicator / Loading Dots */
@keyframes dotJump {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0);
    }
}

.loading-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #888;
    margin: 0 2px;
    animation: dotJump 1s infinite alternate;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* 6. Utility: Attachment "Pop" */
.btn-icon:active {
    transform: scale(0.9) rotate(-10deg);
}