/* ==========================================
   RESET & CUSTOM SCROLLBARS
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #3a3a45 #0f0f11;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f11;
    border-left: 1px solid #1a1a1f;
}

::-webkit-scrollbar-thumb {
    background: #3a3a45;
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #10a37f;
}

body {
    background-color: #0f0f11;
    color: #ececec;
    min-height: 100vh;
}

/* ==========================================
   ANNOUNCEMENT BANNER
========================================== */
.announcement-banner {
    background: linear-gradient(90deg, #10a37f 0%, #0e8f6e 100%);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    position: relative;
    box-shadow: 0 4px 10px rgba(16, 163, 127, 0.2);
}

.close-banner {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    position: absolute;
    right: 20px;
    opacity: 0.8;
    font-size: 1rem;
}

.close-banner:hover {
    opacity: 1;
}

/* ==========================================
   NAVIGATION BAR
========================================== */
.navbar {
    display: flex;
    align-items: center;
    padding: 15px 40px;
    background-color: #1a1a1f;
    border-bottom: 1px solid #2d2d35;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-right: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i {
    color: #10a37f;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #8e8e99;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #fff;
    background-color: #2d2d35;
}

.nav-btn.active {
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid #10a37f;
    border-radius: 0;
}

/* ==========================================
   MAIN LAYOUT & ANIMATIONS
========================================== */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.page {
    display: none;
}

.page.active-page {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-text {
    margin-bottom: 30px;
}

.header-text h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.header-text p {
    color: #8e8e99;
}

.icon-circle {
    background-color: rgba(16, 163, 127, 0.1);
    color: #10a37f;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    margin: 0 auto 15px auto;
}

#token-page .header-text {
    text-align: center;
}

/* ==========================================
   STEPPER UI
========================================== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 20px;
}

.step {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #2d2d35;
    color: #8e8e99;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step.active {
    background-color: #10a37f;
    color: #fff;
    box-shadow: 0 0 10px rgba(16, 163, 127, 0.4);
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: #2d2d35;
    margin: 0 15px;
    transition: all 0.3s ease;
}

.step-line.active {
    background-color: #10a37f;
}

/* ==========================================
   CARDS & GRIDS
========================================== */
.card {
    background-color: #1a1a1f;
    border: 1px solid #2d2d35;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.centered-card {
    max-width: 600px;
    margin: 0 auto;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.step-content {
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #2d2d35;
    transition: opacity 0.3s;
}

.step-content:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.disabled-content {
    opacity: 0.4;
    pointer-events: none;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.85rem;
    color: #8e8e99;
    margin-bottom: 15px;
}

/* ==========================================
   INPUTS & FORMS
========================================== */
.input-group {
    display: flex;
    gap: 10px;
}

input[type="text"], textarea {
    flex-grow: 1;
    background-color: #0f0f11;
    border: 1px solid #3a3a45;
    color: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #10a37f;
    box-shadow: 0 0 0 1px #10a37f;
}

input:disabled, textarea:disabled {
    background-color: #16161a;
    cursor: not-allowed;
}

textarea {
    width: 100%;
    resize: vertical;
}

.key-count {
    color: #10a37f;
    font-weight: 600;
    font-size: 0.85rem;
}

.action-row {
    display: flex;
    gap: 10px;
}

/* ==========================================
   BUTTONS
========================================== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #2d2d35;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #3a3a45;
}

.btn-secondary {
    background-color: #1a1a1f;
    border: 1px solid #3a3a45;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #2d2d35;
}

.btn-success {
    background-color: #10a37f;
    color: #fff;
    font-size: 1rem;
}

.btn-success:hover:not(:disabled) {
    background-color: #0e8f6e;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.full-width {
    width: 100%;
}

.button-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

/* ==========================================
   UTILITIES & ALERTS
========================================== */
.mb-2 { margin-bottom: 10px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.links a, .text-link {
    color: #10a37f;
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 15px;
    white-space: nowrap;
}

.links a:hover, .text-link:hover {
    text-decoration: underline;
}

.error-msg {
    color: #ff4a4a;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 18px;
}

.warning-box {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 8px;
    color: #eab308;
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    align-items: flex-start;
}

.info-box {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(16, 163, 127, 0.1);
    border: 1px solid rgba(16, 163, 127, 0.2);
    border-radius: 8px;
    color: #10a37f;
    display: flex;
    gap: 12px;
    font-size: 0.9rem;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

.empty-state {
    text-align: center;
    color: #8e8e99;
    padding: 40px 0;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ==========================================
   TOKEN RESULT CARD
========================================== */
.token-result-card {
    padding: 0;
    overflow: hidden;
    animation: fadeIn 0.4s ease-in-out;
}

.token-status-header {
    background-color: rgba(16, 163, 127, 0.1);
    color: #10a37f;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #2d2d35;
}

.token-details-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(45, 45, 53, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10a37f;
    font-size: 1.1rem;
}

.detail-text {
    display: flex;
    flex-direction: column;
}

.detail-text .label {
    font-size: 0.8rem;
    color: #5a5a66;
    margin-bottom: 2px;
}

.detail-text .value {
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
    word-break: break-all;
}

.plan-value { color: #10a37f !important; }
.expiry-value { color: #10a37f !important; }
.token-value { color: #8b5cf6 !important; }

/* ==========================================
   TOAST NOTIFICATIONS
========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #1a1a1f;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 5px solid #3a3a45;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    min-width: 280px;
    transform: translateX(120%);
    animation: slideInRight 0.3s forwards, fadeOut 0.3s 3.7s forwards;
}

.toast.success { border-left-color: #10a37f; }
.toast.success i { color: #10a37f; }
.toast.error { border-left-color: #ff4a4a; }
.toast.error i { color: #ff4a4a; }
.toast.warning { border-left-color: #eab308; }
.toast.warning i { color: #eab308; }

@keyframes slideInRight {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(120%); }
}

/* ==========================================
   SKELETON LOADING ANIMATION
========================================== */
.skeleton {
    background: #2d2d35;
    background: linear-gradient(90deg, #2d2d35 25%, #3a3a45 50%, #2d2d35 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   MODAL & VISUAL GUIDE STYLES
========================================== */
.guide-btn {
    background: none;
    border: none;
    color: #10a37f;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.guide-btn:hover {
    background-color: rgba(16, 163, 127, 0.1);
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-in-out;
}

.modal-content {
    background-color: #1a1a1f;
    border: 1px solid #2d2d35;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2d2d35;
    background-color: rgba(16, 163, 127, 0.05);
}

.modal-header h3 {
    margin: 0;
    color: #10a37f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: transparent;
    border: none;
    color: #8e8e99;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #ff4a4a;
}

.modal-body {
    padding: 25px 20px;
}

.guide-steps {
    padding-left: 20px;
    color: #ececec;
    line-height: 1.6;
}

.guide-steps li {
    margin-bottom: 12px;
}

kbd {
    background-color: #2d2d35;
    border: 1px solid #3a3a45;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #10a37f;
}

.modal-warning {
    margin-top: 20px;
    padding: 12px;
    background-color: rgba(234, 179, 8, 0.1);
    border-left: 4px solid #eab308;
    border-radius: 4px;
    color: #eab308;
    font-size: 0.9rem;
}

.modal-warning code {
    color: #fff;
    background: #000;
    padding: 2px 4px;
    border-radius: 3px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #2d2d35;
    background-color: #0f0f11;
}

/* ==========================================
   MOBILE OPTIMIZATION (MEDIA QUERIES)
========================================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .logo {
        margin-right: 0;
        font-size: 1.5rem;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .card {
        padding: 15px;
    }

    .stepper {
        padding: 0 5px;
    }

    .step-line {
        margin: 0 5px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group .btn {
        width: 100%;
    }

    .button-right {
        flex-direction: column;
        align-items: stretch;
    }

    .button-right .text-link {
        margin-left: 0;
        text-align: center;
        display: block;
        margin-bottom: 10px;
    }
    
    .links a {
        margin-left: 0;
        margin-right: 15px;
    }
}