/* Velzon Style Main Landing Page Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --vz-body-bg: #151824;
    --vz-body-color: #f3f3f9;
    --vz-primary: #405189;
    --vz-primary-hover: #364474;
    --vz-success: #0ab39c;
    --vz-success-hover: #09a18c;
    --vz-secondary: #3577f1;
    --vz-danger: #f06548;
    --vz-warning: #f7b84b;
    --vz-info: #299cdb;
    --vz-card-bg: rgba(30, 35, 52, 0.9);
    --vz-border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Poppins', 'Inter', sans-serif;
    background: linear-gradient(135deg, #1f2438 0%, #121520 100%);
    color: var(--vz-body-color);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Header Area */
header {
    text-align: center;
    margin-bottom: 35px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #a3b8cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

header h1 i {
    color: var(--vz-success);
    filter: drop-shadow(0 2px 10px rgba(10, 179, 156, 0.3));
    animation: mailBounce 2s infinite ease-in-out;
}

header p {
    font-size: 14px;
    color: #878a99;
    font-family: 'Inter', sans-serif;
}

/* Premium Card Layout */
.card-box {
    background-color: var(--vz-card-bg);
    border: 1px solid var(--vz-border-color);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

/* Email Display Bar */
.email-display {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#tempEmail {
    flex: 1;
    min-width: 250px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vz-border-color);
    border-radius: 4px;
    outline: none;
    text-align: left;
    font-family: monospace;
    letter-spacing: 0.5px;
    transition: border-color 0.15s ease-in-out;
}

#tempEmail:focus {
    border-color: var(--vz-success);
}

/* Buttons styling */
button, .btn-link {
    font-family: inherit;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

.btn-copy:hover {
    background-color: var(--vz-success-hover);
    transform: translateY(-1px);
}

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

.btn-new:hover {
    background-color: var(--vz-primary-hover);
    transform: translateY(-1px);
}

.btn-refresh {
    background-color: rgba(53, 119, 241, 0.1);
    color: var(--vz-secondary);
    padding: 8px 16px;
    font-size: 12px;
}

.btn-refresh:hover {
    background-color: var(--vz-secondary);
    color: white;
}

.btn-restore {
    background-color: rgba(255, 255, 255, 0.05);
    color: #abb9e8;
    width: 100%;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    font-size: 13px;
}

.btn-restore:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Grid Layout for details */
.details-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Token Management styling */
.token-section {
    padding-top: 15px;
    border-top: 1px solid var(--vz-border-color);
}

.token-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.token-label {
    font-weight: 500;
    color: #abb9e8;
    font-size: 13px;
    white-space: nowrap;
}

#tokenInput {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vz-border-color);
    border-radius: 4px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 12px;
    font-family: monospace;
    outline: none;
}

.btn-copy-token {
    padding: 8px 16px;
    font-size: 12px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.btn-copy-token:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.token-hint {
    font-size: 11px;
    color: #878a99;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.token-url {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #abb9e8;
    word-break: break-all;
}

.btn-copy-url {
    padding: 4px 8px;
    background: none;
    color: #878a99;
}

.btn-copy-url:hover {
    color: white;
}

/* Restore Box Form */
.restore-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.restore-form-wrapper {
    margin-top: 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vz-border-color);
    padding: 15px;
    border-radius: 4px;
    display: flex;
    gap: 8px;
}

.restore-form-wrapper input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vz-border-color);
    border-radius: 4px;
    padding: 10px 14px;
    color: white;
    outline: none;
    font-size: 13px;
}

.restore-form-wrapper input:focus {
    border-color: var(--vz-primary);
}

.btn-restore-submit {
    background-color: var(--vz-primary);
    color: white;
    padding: 10px 20px;
    font-size: 13px;
}

.btn-restore-submit:hover {
    background-color: var(--vz-primary-hover);
}

/* Inbox & Emails Listing */
.inbox {
    background-color: var(--vz-card-bg);
    border: 1px solid var(--vz-border-color);
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--vz-border-color);
}

.inbox-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.inbox-status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--vz-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--vz-success);
    animation: pulseGlow 1.5s infinite;
}

.inbox-badge {
    background-color: rgba(10, 179, 156, 0.1);
    color: var(--vz-success);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
}

/* List of emails */
#emailList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-emails {
    text-align: center;
    padding: 40px 20px;
}

.no-emails p {
    font-size: 15px;
    color: #abb9e8;
    margin-bottom: 8px;
}

.no-emails .hint {
    font-size: 12px;
    color: #878a99;
    font-family: 'Inter', sans-serif;
}

.email-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--vz-border-color);
    border-radius: 4px;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    animation: fadeInUp 0.4s ease-out;
}

.email-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.email-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* Ensures truncation works */
}

.email-from {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.email-subject {
    font-size: 13px;
    color: #878a99;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Inter', sans-serif;
}

.email-date {
    font-size: 11px;
    color: #878a99;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    margin-left: 15px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1e2334;
    border: 1px solid var(--vz-border-color);
    margin: 8% auto;
    padding: 0;
    width: 90%;
    max-width: 750px;
    border-radius: 6px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: modalSlideDown 0.3s ease-out;
    overflow: hidden;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #878a99;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
}

.close:hover {
    color: white;
}

/* Modal Internal layout */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--vz-border-color);
    background-color: rgba(0, 0, 0, 0.15);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    padding-right: 20px;
}

.modal-meta-row {
    padding: 15px 24px;
    border-bottom: 1px solid var(--vz-border-color);
    font-size: 12px;
    color: #abb9e8;
    background-color: rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-meta-row strong {
    color: #ffffff;
}

.modal-body {
    padding: 24px;
    background-color: #ffffff;
    color: #333333;
    min-height: 250px;
    max-height: 450px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

/* Animations */
@keyframes mailBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(10, 179, 156, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(10, 179, 156, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(10, 179, 156, 0);
    }
}

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

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

/* Responsive queries */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .email-display {
        flex-direction: column;
    }
    
    .email-display button {
        width: 100%;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .restore-form-wrapper {
        flex-direction: column;
    }
    
    .restore-form-wrapper button {
        width: 100%;
    }
}
