/* Home Page Styles - Dark Theme */

@font-face {
    font-family: 'Eurostile';
    src: url('/fonts/Eurostile.ttf') format('truetype');
}

@font-face {
    font-family: 'Eurostile Bold';
    src: url('/fonts/Eurostile-Bold Regular.ttf') format('truetype');
}

:root {
    --whatsapp-green: #25D366;
    --whatsapp-dark: #128C7E;
    --accent-gradient: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    --dark-bg: #0a0a0a;
    --card-bg: rgba(31, 31, 31, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Eurostile', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(37, 211, 102, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(18, 140, 126, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(37, 211, 102, 0.05) 0%, transparent 70%),
        var(--dark-bg);
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(18, 140, 126, 0.05));
    animation: float 20s infinite ease-in-out;
}

.shape:nth-child(1) { width: 400px; height: 400px; top: -100px; left: -100px; animation-delay: 0s; }
.shape:nth-child(2) { width: 300px; height: 300px; top: 50%; right: -100px; animation-delay: -5s; }
.shape:nth-child(3) { width: 200px; height: 200px; bottom: 10%; left: 20%; animation-delay: -10s; }
.shape:nth-child(4) { width: 150px; height: 150px; top: 30%; left: 60%; animation-delay: -15s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(20px, 10px) rotate(3deg); }
}

/* Header */
.home-header {
    background: rgba(31, 31, 31, 0.9);
    backdrop-filter: blur(20px);
    padding: 15px 30px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1);
}

.home-header h1 {
    font-family: 'Eurostile Bold', sans-serif;
    font-size: 1.5em;
    background: linear-gradient(135deg, #fff 0%, #25D366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

#user-info button {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff6b6b;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Eurostile', sans-serif;
    transition: all 0.3s ease;
}

#user-info button:hover {
    background: rgba(255, 100, 100, 0.3);
}

/* Main Container */
.home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 50px;
    min-height: calc(100vh - 100px);
}

/* Loading State */
.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 100px 20px;
}

.spinner {
    border: 4px solid rgba(37, 211, 102, 0.2);
    border-top: 4px solid var(--whatsapp-green);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    font-size: 1.1em;
}

/* Error State */
.error-message {
    text-align: center;
    color: var(--text-primary);
    padding: 60px 20px;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.2);
    border-radius: 20px;
    max-width: 500px;
    margin: 100px auto;
}

.error-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.error-message p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.retry-btn {
    padding: 12px 30px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Eurostile', sans-serif;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

/* Countries Grid */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* Section Header */
.section-header {
    margin-top: 40px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(37, 211, 102, 0.3);
}

.section-header:first-child {
    margin-top: 0;
}

.section-header h2 {
    font-family: 'Eurostile Bold', sans-serif;
    color: var(--text-primary);
    font-size: 1.8em;
    margin: 0;
    text-align: left;
}

.section-count {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin: 5px 0 0 0;
    text-align: left;
}

/* Country Card */
.country-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.country-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.country-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 211, 102, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(37, 211, 102, 0.1);
}

.country-card:hover::before {
    opacity: 1;
}

.country-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.country-flag {
    font-size: 48px;
    line-height: 1;
}

.country-info h3 {
    margin: 0 0 5px 0;
    font-family: 'Eurostile Bold', sans-serif;
    font-size: 1.2em;
    color: var(--text-primary);
}

.country-code {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.number-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.quantity-badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(37, 211, 102, 0.15);
    color: var(--whatsapp-green);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.quantity-badge.low {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.3);
}

.quantity-badge.out {
    background: rgba(255, 100, 100, 0.15);
    color: #ff6b6b;
    border-color: rgba(255, 100, 100, 0.3);
}

/* Number Type Badge */
.number-type {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.number-type.standard {
    background: linear-gradient(135deg, rgba(132, 250, 176, 0.2), rgba(143, 211, 244, 0.2));
    color: #8fd3f4;
    border: 1px solid rgba(143, 211, 244, 0.3);
}

.number-type.premium {
    background: linear-gradient(135deg, rgba(168, 237, 234, 0.2), rgba(254, 214, 227, 0.2));
    color: #fed6e3;
    border: 1px solid rgba(254, 214, 227, 0.3);
}

.number-type.elite {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2), rgba(245, 87, 108, 0.2));
    color: #f093fb;
    border: 1px solid rgba(240, 147, 251, 0.3);
}

.number-type.diamond {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(0, 242, 254, 0.2));
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.number-type.special {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.2), rgba(254, 225, 64, 0.2));
    color: #fee140;
    border: 1px solid rgba(254, 225, 64, 0.3);
}

.price-display {
    font-family: 'Eurostile Bold', sans-serif;
    font-size: 1.8em;
    color: var(--whatsapp-green);
    margin-top: 15px;
    text-align: center;
    text-shadow: 0 0 20px rgba(37, 211, 102, 0.3);
}

.buy-btn {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Eurostile', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.buy-btn:disabled {
    background: rgba(100, 100, 100, 0.3);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Footer */
.home-footer {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    text-align: center;
    margin-top: 50px;
}

.footer-content p {
    color: var(--text-secondary);
    margin: 5px 0;
}

.footer-content a {
    color: var(--whatsapp-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Auth Container Override for Home Page */
.auth-container {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .home-header {
        padding: 12px 15px;
    }
    
    .home-header h1 {
        font-size: 1em;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .home-container {
        padding: 85px 12px 30px;
    }
    
    .countries-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .country-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .country-flag {
        font-size: 40px;
    }
    
    .section-header h2 {
        font-size: 1.3em;
    }
    
    .price-display {
        font-size: 1.5em;
    }
    
    .buy-btn {
        padding: 12px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .home-header {
        padding: 10px 12px;
    }
    
    .logo-section {
        gap: 8px;
    }
    
    .header-logo {
        width: 36px;
        height: 36px;
    }
    
    .home-header h1 {
        font-size: 0.85em;
    }
    
    .home-container {
        padding: 75px 10px 25px;
    }
    
    .countries-grid {
        gap: 12px;
    }
    
    .country-card {
        padding: 16px;
        border-radius: 14px;
    }
    
    .country-header {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .country-flag {
        font-size: 36px;
    }
    
    .country-info h3 {
        font-size: 1.05em;
    }
    
    .country-code {
        font-size: 0.85em;
    }
    
    .detail-row {
        margin-bottom: 10px;
    }
    
    .detail-label {
        font-size: 0.85em;
    }
    
    .quantity-badge {
        padding: 4px 10px;
        font-size: 0.8em;
    }
    
    .number-type {
        padding: 5px 10px;
        font-size: 0.7em;
    }
    
    .price-display {
        font-size: 1.4em;
        margin-top: 12px;
    }
    
    .buy-btn {
        padding: 12px;
        font-size: 0.9em;
        border-radius: 10px;
        margin-top: 12px;
    }
    
    .section-header {
        margin-top: 25px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .section-header h2 {
        font-size: 1.15em;
    }
    
    .section-count {
        font-size: 0.85em;
    }
    
    #user-info {
        font-size: 0.8em;
        gap: 10px;
    }
    
    #user-info button {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    
    .home-footer {
        padding: 20px 15px;
        margin-top: 30px;
    }
    
    .footer-content p {
        font-size: 0.85em;
    }
}

@media (max-width: 360px) {
    .home-header h1 {
        font-size: 0.75em;
    }
    
    .header-logo {
        width: 32px;
        height: 32px;
    }
    
    .country-card {
        padding: 14px;
    }
    
    .country-flag {
        font-size: 32px;
    }
    
    .price-display {
        font-size: 1.3em;
    }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
    .home-header {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .home-container {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    
    .home-footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .country-card:hover {
        transform: none;
    }
    
    .country-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .buy-btn:hover {
        transform: none;
    }
    
    .buy-btn:active {
        transform: scale(0.97);
    }
}
