/* =========================================
   KRISH FLORIST - EMERALD & GOLD THEME
   ========================================= */

:root {
    /* COLORS */
    --primary: #2f6f4e;
    /* Emerald */
    --primary-dark: #1e4a33;
    --primary-light: #e6f0eb;
    --accent: #d4af37;
    /* Gold */
    --accent-hover: #b59226;
    --bg-body: #ffffff;
    --bg-light: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.95);

    /* TEXT */
    --text-main: #2c3e50;
    --text-muted: #666666;
    --text-light: #999999;

    /* SHADOWS & RADIUS */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* LAYOUT */
    --header-height: 80px;
    --sidebar-width: 260px;
    --container-width: 1200px;
}

/* =========================================
   RESET & BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', 'Segoe UI', sans-serif;
    color: var(--text-main);
    background: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

ul {
    list-style: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

/* =========================================
   UTILITIES / COMPONENTS
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

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

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input,
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: 0.3s;
}

.form-input:focus,
.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

/* =========================================
   PUBLIC WEBSITE STYLES
   ========================================= */
/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1250px;
    margin: auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    /* Add gap for smaller screens */
}

.logo {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links li a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: 0.3s;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

@media(max-width: 900px) {
    .navbar {
        height: auto !important;
        padding-bottom: 10px;
    }

    .nav-container {
        flex-wrap: wrap;
    }

    /* ROW 1: Logo (Left) & Toggle (Right) */
    .logo {
        order: 1;
        flex: 1;
        /* Take up all available space to push toggle to right */
        text-align: left;
    }

    .menu-toggle {
        display: block;
        order: 2;
        flex: 0 0 auto;
        /* Do not grow */
        margin-left: 15px;
    }

    /* SHOW MAIN SEARCH ON MOBILE (Row 2) */
    .nav-search {
        display: block !important;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        /* Force new line */
        margin: 15px 0 5px 0 !important;
        order: 3;
    }

    .nav-search form {
        width: 100%;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        /* Push below the expanded header height */
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: var(--shadow-md);
        max-height: 80vh;
        overflow-y: auto;
        margin-top: 10px;
        /* Space from search bar */
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }

    /* Hide the list-item search since we used the main one */
    .mobile-search-li {
        display: none !important;
    }
}

/* SEARCH BAR */
.nav-search {
    flex: 0 1 350px;
    /* Don't grow too much */
    margin: 0 15px;
}

.nav-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-right: none;
    border-radius: 50px 0 0 50px;
    outline: none;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    transition: 0.3s;
}

.nav-search input:focus {
    background: white;
    border-color: var(--primary);
}

.nav-search button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.nav-search button:hover {
    background: var(--primary-dark);
}

/* SEARCH SUGGESTIONS DROPDOWN */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: none;
    /* Hidden by default */
    overflow: hidden;
}

.search-suggestions div {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.95rem;
    color: #444;
    transition: 0.2s;
}

.search-suggestions div:hover {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: 25px;
}

.search-suggestions div:last-child {
    border-bottom: none;
}


/* Hero Generic */
.page-header {
    background: var(--primary);
    color: white;
    padding: 140px 0 60px;
    text-align: center;
    background-image: url('../images/herotest1.svg');
    /* Fallback */
    background-size: cover;
    background-position: center;
}

.page-header h1 {
    font-size: 3rem;
    color: white;
    margin-bottom: 10px;
}

/* =========================================
   SEASONAL THEMES
   ========================================= */
/* Valentine */
body.season-Valentine {
    --primary: #D32F2F;
    --primary-light: #ffebee;
    --bg-body: #fff0f5;
}

body.season-Valentine .navbar {
    border-bottom-color: rgba(211, 47, 47, 0.2);
}

/* Diwali */
body.season-Diwali {
    --primary: #FF6F00;
    --primary-light: #fff8e1;
    --bg-body: #fff8e1;
}

body.season-Diwali .navbar {
    border-bottom-color: rgba(255, 111, 0, 0.2);
}

/* =========================================
   ADMIN PANEL STYLES
   ========================================= */
body.admin-body {
    background: #f4f7f6;
    display: flex;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: white;
    height: 100vh;
    position: fixed;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 50;
    padding: 20px 0;
    overflow-y: auto;
    /* Enable scrolling */
    max-height: 100vh;
}

.admin-brand {
    padding: 0 30px 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 30px;
    color: var(--text-muted);
    font-weight: 500;
    transition: 0.2s;
    border-left: 4px solid transparent;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.admin-nav a i {
    width: 20px;
}

.admin-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 40px;
    min-height: 100vh;
}

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    font-family: var(--font-body);
}

.stat-info .count {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Data Tables */
.table-wrapper {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 30px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--text-muted);
}

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

.admin-table td img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Login Page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
}

.login-box {
    width: 400px;
    padding: 40px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 30px;
}

/* Floating Icons (Bottom Right) */
.floating-icons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1.8rem;
    transition: 0.3s;
}

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

.float-btn.whatsapp {
    background: #25D366;
    position: relative;
    /* No box-shadow animation here to avoid heavy paint. Use a composited pseudo-element for the pulsing ring */
}

.float-btn.call {
    background: var(--primary);
}

/* Composited pulse using transform and opacity on a pseudo-element (GPU friendly) */
.float-btn.whatsapp::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140%;
    height: 140%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: rgba(37,211,102,0.18);
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
    animation: pulse-ring 2000ms infinite;
}

@keyframes pulse-ring {
    0% { transform: translate(-50%, -50%) scale(0.0); opacity: 0.6; }
    70% { transform: translate(-50%, -50%) scale(1.0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1.0); opacity: 0; }
}

/* Accessible visually-hidden helper */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* BACK TO TOP BUTTON */
#backToTop {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--text-main);
    color: white;
    border-radius: 50%;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 999;
    box-shadow: var(--shadow-md);
    transition: 0.3s;
    opacity: 0.8;
}

#backToTop:hover {
    background: var(--primary);
    transform: translateY(-5px);
    opacity: 1;
}

/* RESPONSIVE ADMIN */
@media (max-width: 900px) {
    .admin-sidebar {
        width: 70px;
        padding: 20px 0;
    }

    .admin-brand span,
    .admin-nav a span {
        display: none;
    }

    .admin-brand {
        padding: 0 0 20px;
        justify-content: center;
    }

    .admin-nav a {
        padding: 15px 0;
        justify-content: center;
    }

    .admin-main {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 20px;
    }
}