/* Modern CSS Variables */
:root {
    --primary: #0F172A;
    --primary-light: #1E293B;
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: 'Outfit', sans-serif;

    /* Alias for template usage */
    --bg-main: var(--background);
    --bg-card: var(--surface);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.logo {
    height: 90px;
    width: auto;
    margin-bottom: 1rem;
    display: inline-block;
}

.app-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.app-title span.highlight {
    color: var(--accent);
}

/* Search Section */
.search-container {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.input-group {
    position: relative;
    flex: 1;
    min-width: 300px;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: var(--background);
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.5rem;
    text-decoration: none;
}

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

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Orders Grid */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.order-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.order-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.order-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-full {
    grid-column: 1 / -1;
}

.btn-upi {
    background-color: #10B981;
    color: white;
}

.btn-upi:hover {
    background-color: #059669;
}

.btn-card {
    background-color: #F43F5E;
    color: white;
}

.btn-card:hover {
    background-color: #E11D48;
}

.btn-others {
    background-color: #6366F1;
    color: white;
}

.btn-others:hover {
    background-color: #4F46E5;
}

.btn-swiggy {
    background-color: #FC8019;
    color: white;
}

.btn-swiggy:hover {
    background-color: #e67316;
}

.btn-zomato {
    background-color: #E23744;
    color: white;
}

.btn-zomato:hover {
    background-color: #d12f3c;
}

.pay-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

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

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

/* Modals & Popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner-svg {
    width: 100px;
    height: auto;
}

/* Iframe Viewer */
.iframe-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 85vh;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.iframe-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.iframe-content {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

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

    .input-group {
        width: 100%;
        min-width: auto;
    }

    .btn {
        width: 100%;
    }

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