/* ShortDeal.in - Mobile First WebView Styles */

:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #fff3ee;
    --dark: #1a1a2e;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --header-height: 60px;
    --nav-height: 70px;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    overscroll-behavior: none;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    padding-top: var(--header-height);
    padding-bottom: var(--nav-height);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.logo-link { text-decoration: none; }

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(255,107,53,0.3));
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.logo-accent { color: var(--primary); }

.logo-text small {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    margin-left: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.btn-login {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Main */
.app-main { padding: 16px 0 20px; }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.2s;
}

.nav-item i { font-size: 22px; }

.nav-item.active { color: var(--primary); }

.nav-add { position: relative; }

.nav-add-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}

.nav-add.active .nav-add-btn { transform: scale(1.05); }
.nav-add i { font-size: 24px; color: white !important; }

/* Flash Message */
.flash-message {
    position: fixed;
    top: calc(var(--header-height) + 10px);
    left: 16px;
    right: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.flash-success { color: var(--success); border-left: 4px solid var(--success); }
.flash-error { color: var(--danger); border-left: 4px solid var(--danger); }

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Search Bar */
.search-bar {
    background: var(--white);
    border-radius: 50px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    border: 1px solid var(--gray-100);
}

.search-bar i { color: var(--gray-500); font-size: 18px; }
.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--gray-900);
}

/* Category Pills */
.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    margin: 0 -16px 16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    flex-shrink: 0;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-pill.active {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: transform 0.2s;
    border: 1px solid var(--gray-100);
}

.product-card:active { transform: scale(0.98); }

.product-card a { text-decoration: none; color: inherit; }

.product-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: var(--gray-100);
    overflow: hidden;
}

.product-img-wrap img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-img-wrap .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 48px;
}

.product-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-900);
}

.product-info { padding: 12px; }

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--primary);
}

.product-price .amount {
    font-size: 16px;
    font-weight: 800;
}

.product-price .unit {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Buttons */
.btn-primary-app {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255,107,53,0.25);
    transition: transform 0.1s;
}

.btn-primary-app:active { transform: scale(0.98); }
.btn-primary-app:disabled { opacity: 0.6; }

.btn-outline-app {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
}

/* Form */
.form-group { margin-bottom: 16px; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    display: block;
}

.form-control-app {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius);
    font-size: 15px;
    background: var(--white);
    color: var(--gray-900);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

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

textarea.form-control-app { min-height: 100px; resize: vertical; }

/* Login Page */
.login-wrapper {
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
}

.login-hero {
    text-align: center;
    margin-bottom: 32px;
}

.login-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-hero p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 12px;
    padding-left: 12px;
}

/* Image upload */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.image-upload-item {
    aspect-ratio: 1;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 28px;
    position: relative;
    overflow: hidden;
    background: var(--gray-50);
}

.image-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-item .remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Charge rows */
.charge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.charge-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius);
    font-size: 14px;
}

.btn-remove-charge {
    background: var(--gray-100);
    color: var(--danger);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.btn-add-charge {
    background: transparent;
    color: var(--primary);
    border: 1.5px dashed var(--primary);
    padding: 10px;
    border-radius: var(--radius);
    width: 100%;
    font-weight: 600;
    font-size: 14px;
    margin-top: 4px;
}

/* Profile */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 30px 16px;
    margin: -16px -16px 16px;
    border-radius: 0 0 24px 24px;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: var(--shadow-lg);
}

.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-email { font-size: 13px; opacity: 0.9; }

.profile-menu {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    font-weight: 500;
}

.profile-menu-item:last-child { border-bottom: none; }

.profile-menu-item i:first-child {
    font-size: 20px;
    color: var(--primary);
    width: 24px;
}

.profile-menu-item .arrow {
    margin-left: auto;
    color: var(--gray-300);
}

/* Detail page */
.detail-img-slider {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--gray-100);
    overflow: hidden;
    margin: -16px -16px 16px;
}

.detail-img-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.charge-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.charge-item {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    border: 1px solid var(--primary-light);
}

.charge-item .days { font-size: 12px; color: var(--gray-700); font-weight: 600; }
.charge-item .amount { font-size: 18px; font-weight: 800; color: var(--primary); }

.contact-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    justify-content: center;
}

.contact-whatsapp { background: #25D366; color: white; }
.contact-call { background: var(--gray-900); color: white; }

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

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Loading */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Responsive - keep mobile look but slight tweaks for tablet */
@media (min-width: 768px) {
    body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.05); }
    .app-header, .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
