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

:root {
    --primary: #1a1a1a;
    --secondary: #6b7280;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 40% 20%, hsla(280, 100%, 74%, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 100%, 74%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355, 100%, 74%, 0.1) 0px, transparent 50%);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.premium-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.premium-btn svg {
    color: #ffd700;
}

/* Email Section */
.email-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 48px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.email-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.email-container {
    text-align: center;
    position: relative;
    z-index: 1;
}

.email-display {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.email-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    word-break: break-all;
    color: var(--primary);
}

/* Loading animation */
.loading-dots span {
    animation: blink 1.4s infinite both;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.copy-btn {
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.copy-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.05);
}

.copy-btn.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Timer */
.timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.timer {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.timer.warning {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    animation: warning-pulse 1s ease-in-out infinite;
}

@keyframes warning-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.extend-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.extend-btn:hover {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
    transform: translateY(-1px);
}

/* Inbox */
.inbox-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

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

.inbox-header h2 {
    font-size: 20px;
    font-weight: 600;
}

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

.inbox-count {
    color: var(--secondary);
    font-size: 14px;
}

.refresh-btn {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: rotate(180deg);
}

.refresh-btn.refreshing {
    animation: spin 1s linear infinite;
}

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

.inbox-container {
    min-height: 300px;
}

.empty-inbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--secondary);
}

.empty-inbox svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-inbox p {
    margin-bottom: 8px;
}

.hint {
    font-size: 14px;
    opacity: 0.7;
}

/* Email Items */
.email-item {
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    background: var(--background);
}

.email-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

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

.email-item.unread {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.email-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.email-from {
    font-weight: 600;
}

.email-time {
    font-size: 14px;
    color: var(--secondary);
}

.email-subject {
    font-size: 16px;
    margin-bottom: 4px;
}

.email-preview {
    font-size: 14px;
    color: var(--secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: var(--background);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.email-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.email-meta p {
    margin-bottom: 8px;
    color: var(--secondary);
}

.email-meta span {
    color: var(--primary);
}

.email-content {
    line-height: 1.8;
    margin-bottom: 20px;
}

.email-actions {
    display: flex;
    gap: 12px;
}

.forward-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.forward-btn:hover {
    transform: translateY(-2px);
}

/* Premium Modal */
.premium-modal {
    max-width: 480px;
}

.premium-features {
    margin-bottom: 30px;
}

.premium-features h4 {
    margin-bottom: 16px;
    font-size: 18px;
}

.premium-features ul {
    list-style: none;
}

.premium-features li {
    padding: 8px 0;
    color: var(--secondary);
}

.premium-pricing {
    text-align: center;
    margin-bottom: 30px;
}

.price {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
}

.premium-pricing p {
    color: var(--secondary);
}

#premiumForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#customDomain {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
}

#customDomain:focus {
    outline: none;
    border-color: var(--accent);
}

.checkout-btn {
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.checkout-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

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

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

.toast.warning {
    background: var(--warning);
}

/* Ad Container */
.ad-container {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }
    
    header {
        flex-direction: column;
        gap: 16px;
    }
    
    .email-section {
        padding: 24px;
    }
    
    .email-text {
        font-size: 20px;
    }
    
    .email-display {
        flex-direction: column;
    }
    
    .inbox-section {
        padding: 20px;
    }
    
    .modal-content {
        margin: 20px;
    }
}