:root {
    /* Professional "Neo" theme */
    --bg-color: #0b1220;
    --sidebar-bg: rgba(17, 24, 39, 0.86);
    --main-content-bg: #0b1220;

    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(148, 163, 184, 0.22);

    /* Brand gradient */
    --primary: #22c55e;
    --primary-hover: #16a34a;
    --accent: #3b82f6;

    --text-main: #e5e7eb;
    --text-muted: rgba(226, 232, 240, 0.75);

    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #ef4444;

    --card-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    --input-bg: rgba(2, 6, 23, 0.45);

    --ring: rgba(34, 197, 94, 0.35);
    --shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] {
    /* Keep same palette, slightly intensified */
    --bg-color: #070b14;
    --sidebar-bg: rgba(12, 18, 34, 0.9);
    --main-content-bg: #070b14;

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(148, 163, 184, 0.18);

    --primary: #22c55e;
    --primary-hover: #16a34a;
    --accent: #60a5fa;

    --text-main: #e5e7eb;
    --text-muted: rgba(226, 232, 240, 0.72);

    --card-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    --input-bg: rgba(2, 6, 23, 0.6);

    --ring: rgba(34, 197, 94, 0.42);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(0, 0, 0, 0.05), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(0, 0, 0, 0.05), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

[data-theme="dark"] body {
    background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.02), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.02), transparent 40%);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 0.5rem; /* Reduced horizontal padding from 1rem to 0.5rem */
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.02);
    z-index: 1000;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    padding-left: 0.5rem; /* Reduced from 1rem */
}

.logo i {
    color: var(--primary);
}

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

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.875rem 0.75rem; /* Reduced horizontal padding from 1rem to 0.75rem */
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Slightly reduced gap from 1rem */
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(34, 197, 94, 0.12);
    color: var(--primary);
    border: 1px solid rgba(34, 197, 94, 0.22);
}


.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.main-content {
    flex: 1;
    padding: 1rem 3rem; /* Reduced top padding from 2rem */
    position: relative;
    max-height: 100vh;
    overflow-y: auto;
}

header {
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.tool-panel {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tool-panel.active {
    display: block;
}

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

.glass-form {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem 2rem; /* Reduced top/bottom padding */
    max-width: 600px;
    box-shadow: var(--card-shadow);
}

.file-upload-wrapper {
    border: 2px dashed var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem 1rem; /* Reduced padding from 2rem */
    text-align: center;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-wrapper i {
    color: var(--primary);
    margin-bottom: 1rem;
}

.file-upload-wrapper p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group input[type="text"], .input-group input[type="password"], .input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input[type="text"]:focus, .input-group select:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Sub-tabs Fix */
.sub-tab {
    display: none;
}
.sub-tab.active {
    display: block !important;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--primary);
}
.glass-table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    overflow-x: auto;
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
}

.glass-table th, .glass-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.glass-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.glass-table tbody tr:hover {
    background: var(--glass-border);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

.header-right {
    display: flex;
    gap: 1rem;
}

.btn-primary-small {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--glass-border);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 950px; /* Increased to accommodate 3 plans side-by-side */
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease-out;
}

.modal-content.glass-form {
    padding: 1.5rem 2rem;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.75rem;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Premium Overlay */
.premium-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-color);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.5rem;
    text-align: center;
    color: var(--text-main);
}

.premium-content i {
    color: #fbbf24;
    margin-bottom: 1.5rem;
}

.premium-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.premium-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 300px;
}

/* File List Preview */
.file-list-preview div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.file-list-preview i {
    color: var(--primary);
    font-size: 0.8rem;
}

.dynamic-textarea {
    margin-top: 20px;
    width: 100%;
    border-radius: 12px;
    padding: 15px;
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    outline: none;
}

.dynamic-textarea:focus {
    border-color: var(--primary);
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Better width for 3 columns */
    gap: 1.25rem;
    width: 100%;
    margin-top: 1rem;
}

.plan-card {
    background: var(--sidebar-bg);
    border: 2px solid var(--glass-border); /* Thicker border */
    border-radius: 1.25rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.plan-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.plan-card.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.plan-card.active::after {
    content: '\f058'; /* FontAwesome check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary);
    color: white;
    width: 25px;    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.plan-card h4 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.plan-card .price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.plan-card .duration {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.plan-card ul {
    list-style: none;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-main);
    padding: 0;
    margin-top: auto;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

.plan-card ul li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-card ul li i {
    color: var(--success);
    margin-right: 0.5rem;
}

/* Custom Alert Modal */
.alert-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.alert-modal {
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--card-shadow);
    animation: modalSlideUp 0.3s ease-out;
}

.alert-modal h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.alert-modal p {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.alert-modal .btn-primary {
    padding: 0.75rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.ad-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-ad {
    height: auto; /* Allow it to be smaller if empty */
    min-height: 0;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
    border-radius: 1rem;
}

.sidebar-ad {
    height: 250px;
    margin: 2rem 0.5rem; /* Reduced horizontal margin from 1rem to 0.5rem */
    border-radius: 0.75rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
