:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Subtle pulse animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.lightning-overlay {
    display: none;
}

/* Header */
.header {
    padding: 48px 0 32px;
    position: relative;
    z-index: 10;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
}

.logo-text {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 16px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    animation: slideDown 0.5s ease-out;
}

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

.alert-icon {
    font-size: 1.5rem;
}

.alert-banner span {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 0 0 80px;
}

/* Section Styles - Glassmorphism */
.map-section,
.form-section,
.reports-section {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.section-title .icon {
    font-size: 1.75rem;
}

/* Map Container */
.map-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#map {
    height: 500px;
    width: 100%;
    border-radius: 16px;
}

.map-legend {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.refresh-icon {
    display: inline-block;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Form Styles */
.report-form {
    color: var(--text-primary);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    letter-spacing: 0.3px;
}

.form-input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: rgba(51, 65, 85, 0.4);
    color: var(--text-primary);
}

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

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(51, 65, 85, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.location-options {
    margin: 28px 0;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.location-display {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 14px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Stock Section */
.stock-section {
    margin: 32px 0;
}

.stock-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.stock-item {
    background: rgba(51, 65, 85, 0.4);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.stock-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(51, 65, 85, 0.5);
}

.stock-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stock-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stock-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stock-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-label {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.radio-custom.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.radio-custom.yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.radio-custom.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.radio-label input[type="radio"]:checked + .radio-custom {
    transform: scale(1.02);
}

.radio-label input[type="radio"]:checked + .radio-custom.green {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.radio-label input[type="radio"]:checked + .radio-custom.yellow {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.radio-label input[type="radio"]:checked + .radio-custom.red {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-submit {
    margin-top: 28px;
    font-size: 1rem;
    padding: 14px 32px;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.report-card {
    background: rgba(51, 65, 85, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.report-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
    gap: 12px;
}

.report-store {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.report-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.report-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.report-stocks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-stock-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.report-stock-icon {
    font-size: 1.4rem;
}

.report-stock-status {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.report-stock-item span:last-child {
    font-weight: 700;
    font-size: 0.875rem;
}

.report-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-share {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 10px 20px;
    font-size: 0.875rem;
}

.btn-share:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
}

.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.share-content {
    color: var(--text-primary);
}

.share-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.share-link-container {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.share-link-container .form-input {
    flex: 1;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.share-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    font-size: 0.9rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2, #0c85d0);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877f2, #0e5fc7);
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25d366, #1da851);
}

/* Footer */
.footer {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 32px 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 48px;
}

.footer p {
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    align-items: center;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-links span {
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-text {
        font-size: 2.25rem;
    }
    
    .logo-icon {
        font-size: 2.25rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    #map {
        height: 400px;
    }
    
    .map-legend {
        position: static;
        margin-top: 16px;
    }
    
    .stock-options {
        flex-direction: column;
    }
    
    .radio-label {
        min-width: 100%;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .share-link-container {
        flex-direction: column;
    }
    
    .map-section,
    .form-section,
    .reports-section {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 32px 0 24px;
    }
    
    .logo-text {
        font-size: 1.875rem;
    }
    
    .logo-icon {
        font-size: 1.875rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .alert-banner {
        padding: 14px 18px;
    }
    
    #map {
        height: 350px;
    }
    
    .map-section,
    .form-section,
    .reports-section {
        padding: 20px;
    }
    
    .modal-content {
        padding: 24px;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Dark mode support (if user prefers) */
@media (prefers-color-scheme: dark) {
    /* Already dark by default */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
