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

:root {
    --bg-primary: #171717;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #262626;
    --bg-quaternary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent: #4a9eff;
    --accent-hover: #5aaeff;
    --accent-dark: #3a8eef;
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
    --border: #2a2a2a;
    --border-light: #333333;
    --border-dark: #1a1a1a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #141414;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: breathe 2s ease-in-out infinite;
    box-shadow: 0 0 8px currentColor;
    filter: brightness(1.2);
}

@keyframes breathe {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-avatar:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    transform: scale(1.05);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.username {
    font-weight: 500;
    color: var(--text-primary);
}

.user-plan {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::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-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-quaternary);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.btn-refresh {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transform: rotate(180deg);
}

.btn-refresh:active {
    transform: rotate(360deg);
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-logout:hover {
    color: var(--text-primary);
}

/* Login Screen */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.login-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), #ffffff, rgba(255, 255, 255, 0.6), transparent);
    opacity: 0.6;
    border-radius: var(--radius) var(--radius) 0 0;
}


@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-content {
    color: var(--text-secondary);
}

#active-plans-list {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-secondary);
}

#active-plans-list::-webkit-scrollbar {
    width: 6px;
}

#active-plans-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

#active-plans-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#active-plans-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

#active-plans-list > div {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-secondary);
}

#active-plans-list > div::-webkit-scrollbar {
    width: 6px;
}

#active-plans-list > div::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

#active-plans-list > div::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

#active-plans-list > div::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Expiry timer animations */
.expiry-timer {
    animation: breathe 2s ease-in-out infinite;
}

.expiry-red {
    animation: breathe-red 1.5s ease-in-out infinite;
}

.expiry-yellow {
    animation: breathe-yellow 2s ease-in-out infinite;
}

.expiry-green {
    animation: breathe-green 2.5s ease-in-out infinite;
}

@keyframes breathe-red {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 8px rgba(248, 113, 113, 0.4), 0 0 16px rgba(248, 113, 113, 0.2);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.05);
        text-shadow: 0 0 12px rgba(248, 113, 113, 0.6), 0 0 24px rgba(248, 113, 113, 0.3);
    }
}

@keyframes breathe-yellow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 8px rgba(251, 191, 36, 0.4), 0 0 16px rgba(251, 191, 36, 0.2);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.03);
        text-shadow: 0 0 10px rgba(251, 191, 36, 0.5), 0 0 20px rgba(251, 191, 36, 0.25);
    }
}

@keyframes breathe-green {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 6px rgba(74, 222, 128, 0.3), 0 0 12px rgba(74, 222, 128, 0.15);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.02);
        text-shadow: 0 0 8px rgba(74, 222, 128, 0.4), 0 0 16px rgba(74, 222, 128, 0.2);
    }
}

/* Active plan item hover effect */
.active-plan-item {
    transition: all 0.2s ease;
}

.active-plan-item:hover {
    background: var(--bg-quaternary) !important;
    transform: translateX(4px);
    border-color: var(--border-light) !important;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Plan Cards */
.plan-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.plan-card {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

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

.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.plan-range {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.plan-pricing {
    margin: 1rem 0;
}

.price {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

.price-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.slot-status {
    font-size: 0.875rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.slot-available {
    color: var(--success);
}

.slot-full {
    color: var(--error);
}

.priority-toggle {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

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

.priority-toggle:hover {
    background: var(--bg-quaternary);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.priority-toggle:hover::before {
    left: 100%;
}

.priority-toggle.active {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: #171717;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.qr-code {
    margin: 1.5rem auto;
    padding: 1rem;
    background: #ffffff;
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.qr-code img {
    display: block;
    width: 200px;
    height: 200px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.payment-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.payment-status.waiting {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.payment-status.unconfirmed {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    animation: pulse 2s ease-in-out infinite;
}

.payment-status.confirmed {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--success);
}

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:hover {
    border-color: var(--border-light);
    background: var(--bg-quaternary);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-quaternary);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

/* Remove spinner arrows from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.qr-code {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-code img {
    max-width: 100%;
    border-radius: var(--radius);
}

.payment-details {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 1rem 0;
}

.payment-address {
    word-break: break-all;
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.payment-amount {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

/* Order History */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.order-item:hover {
    background: var(--bg-quaternary);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.order-info {
    flex: 1;
}

.order-id {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.order-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.order-status.waiting {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.order-status.confirmed {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--success);
}

/* Script Display */
.script-display {
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #d4d4d4;
    word-break: break-all;
    margin: 1rem 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.copy-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.success-msg {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.3s ease;
    position: relative;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab.active {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.tab.active::after {
    transform: scaleX(1);
    background: rgba(255, 255, 255, 0.6);
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(74, 158, 255, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1.5rem;
    }

    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

.pause-active-grid {
    grid-template-columns: 1fr !important;
}

.pause-active-grid .card {
    width: 100%;
    max-width: 100%;
}

/* Pause token option selection states */
.pause-option-hours,
.pause-option-days {
    transition: opacity 0.3s ease;
}

.pause-option-hours.faded,
.pause-option-days.faded {
    opacity: 0.5;
}

.pause-option-hours.active,
.pause-option-days.active {
    opacity: 1;
}

    .active-plan-item {
        gap: 0.25rem !important;
        padding: 0.4rem 0.5rem !important;
    }

    .active-plan-item > div {
        gap: 0.25rem !important;
    }

    .active-plan-username {
        max-width: 50px !important;
        font-size: 0.75rem !important;
    }

    .active-plan-item [class*="expiry"] {
        font-size: 0.75rem !important;
    }

    .active-plan-item > div > div {
        font-size: 0.75rem !important;
    }
}


