/* CSS Variables - Design System */
:root {
    --bg-gradient: linear-gradient(160deg, #07090f 0%, #0b0e18 50%, #090c16 100%);
    --panel-glow: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
                  radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
    
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #475569;
    
    --color-vip: #00ff80;
    --color-vip-glow: rgba(0, 255, 128, 0.25);
    --color-accent: #818cf8;
    --color-accent-glow: rgba(129, 140, 248, 0.2);
    --color-danger: #f87171;
    --color-success: #10b981;
    
    --border-glass: 1px solid rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    
    --font-primary: 'Inter', -apple-system, sans-serif;
    --font-heading: 'Outfit', -apple-system, sans-serif;
}

/* Global Reset & Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 20px;
}

/* Layout Wrapper */
#app {
    width: 100%;
    max-width: 500px;
    background: rgba(11, 14, 24, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

#app::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--panel-glow);
    pointer-events: none;
    z-index: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes vip-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes vip-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 128, 0.12); }
    50% { box-shadow: 0 0 28px rgba(0, 255, 128, 0.28); }
}

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

/* Common loading state */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    padding: 40px;
    z-index: 1;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(129, 140, 248, 0.15);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-screen p {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Login Screen & Forms */
.login-container {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 8px;
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--color-text-primary);
    padding: 0 14px;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all 0.25s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    background: rgba(0, 0, 0, 0.35);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

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

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-primary {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, var(--color-accent), #4f46e5);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--color-text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* Header Component */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: var(--border-glass);
    z-index: 1;
}

.panel-header-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-header-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-header-link.chat { background: var(--color-success); }
.btn-header-link.support { background: #24a1de; }

.btn-header-link:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Dashboard Page */
.dashboard-wrapper {
    padding: 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    z-index: 1;
}

/* VIP Banner */
.vip-banner {
    background: linear-gradient(135deg, rgba(0, 20, 8, 0.9) 0%, rgba(0, 35, 15, 0.8) 100%);
    border: 1px solid rgba(0, 255, 128, 0.3);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: vip-glow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.vip-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(0, 255, 128, 0.015) 15px, rgba(0, 255, 128, 0.015) 16px);
    pointer-events: none;
}

.vip-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vip-banner-shield {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0, 50, 20, 0.8), rgba(0, 30, 12, 0.9));
    border: 1px solid rgba(0, 255, 128, 0.35);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 255, 128, 0.2);
}

.vip-banner-info h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-vip);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vip-banner-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: var(--color-text-secondary);
}

.vip-banner-right {
    text-align: right;
}

.vip-banner-right-badge {
    font-size: 9px;
    font-weight: 800;
    color: var(--color-text-secondary);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.vip-banner-right-status {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-vip);
}

/* Tool Grid Section */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(to bottom, var(--color-vip), var(--color-success));
    border-radius: 2px;
}

.status-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-vip);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-vip);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-vip);
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

/* Tool Card */
.tool-card {
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tool-card:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tool-card-icon {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tool-card-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 16px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--color-vip), var(--color-success));
    color: #000;
    border-color: var(--color-vip);
    box-shadow: 0 0 10px rgba(0, 255, 128, 0.3);
    font-weight: 800;
}

/* Community Ads Banner */
.ads-banner {
    background: rgba(8, 12, 28, 0.8);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: auto;
}

.ads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ads-header-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-create-ad {
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    color: var(--color-accent);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-create-ad:hover {
    background: rgba(129, 140, 248, 0.2);
    border-color: var(--color-accent);
}

.ad-display {
    padding: 12px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding-bottom: 8px;
}

.ad-dot {
    width: 6px;
    height: 6px;
    border-radius: 30%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.25s ease;
}

.ad-dot.active {
    width: 14px;
    background: var(--color-accent);
}

/* Tool Subscreen View */
.view-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    z-index: 1;
    animation: fadeIn 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.view-header-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
}

.btn-back {
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    color: var(--color-text-secondary);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
}

/* Active Jobs/Listings inside Tools */
.active-items-section {
    margin-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    padding-top: 14px;
}

.active-items-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.item-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.no-items-message {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 11px;
    padding: 12px;
}

.session-row {
    background: rgba(0, 0, 0, 0.15);
    border: var(--border-glass);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Media pills */
.media-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text-secondary);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}

.media-pill.active {
    background: rgba(129, 140, 248, 0.2);
    border-color: var(--color-accent);
    color: #a5b4fc;
}

/* Virtual Number Services */
.virtual-service-card {
    background: rgba(255,255,255,0.02);
    border: var(--border-glass);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.virtual-service-card:hover {
    background: rgba(255,255,255,0.05);
}

.btn-buy-number {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
    transition: all 0.2s ease;
}

.btn-buy-number:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-buy-number:disabled {
    background: var(--color-text-muted);
    cursor: not-allowed;
    box-shadow: none;
}
