/* ==========================================================================
   AI TEXEL - GLOBAL DESIGN SYSTEM & COMPONENT STYLES
   ========================================================================== */

:root {
    --bg-dark: #0f1115;
    --bg-panel: #1a1c23;
    --bg-panel-light: #252830;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --border-color: #2d313f;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar & Topbar */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-icon::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid white;
    border-radius: 3px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--text-light);
}

.nav-item.active {
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.logout-btn {
    margin: 16px;
    margin-top: auto;
    padding: 12px;
    background-color: var(--bg-panel-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #ef4444;
    border-color: #ef4444;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    height: 70px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}

.search-bar {
    position: relative;
    width: 350px;
}

.search-bar input {
    width: 100%;
    background-color: var(--bg-panel-light);
    border: 1px solid var(--border-color);
    padding: 10px 16px 10px 40px;
    border-radius: 8px;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent);
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.notification-btn:hover {
    color: var(--text-light);
}

.notification-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Dashboard Content */
.dashboard-content {
    padding: 32px;
}

.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.icon-blue {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.icon-purple {
    background-color: rgba(138, 43, 226, 0.1);
    color: #8a2be2;
}

.icon-green {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.icon-pink {
    background-color: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Action Buttons */
.btn-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-view-all {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-view-all:hover {
    background-color: var(--bg-panel-light);
}

/* Table */
.table-container {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h2 {
    font-size: 18px;
    font-weight: 600;
}

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

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-banned {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: var(--bg-panel-light);
    color: var(--text-light);
}

.action-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Subscription Page Styles */
.tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-light);
    background-color: var(--bg-panel-light);
}

.tab-btn.active {
    color: var(--text-light);
    background-color: var(--accent);
}

.tab-content {
    display: none;
}

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

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.plan-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.1);
}

.plan-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-badge.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.plan-badge.inactive {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.plan-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 36px;
    font-weight: 800;
    margin: 20px 0;
    display: flex;
    align-items: baseline;
}

.plan-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.plan-features {
    list-style: none;
    margin-bottom: 32px;
    flex-grow: 1;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.plan-features li svg {
    color: #10b981;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.plan-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.plan-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-light);
    transition: all 0.2s;
}

.plan-btn.edit {
    background-color: var(--bg-panel-light);
}

.plan-btn.edit:hover {
    background-color: var(--border-color);
}

.plan-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

/* User Auth Pages (Login, Register & Forgot Password) */
.auth-body {
    background-color: #131417;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.auth-card {
    background-color: #1f2025;
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    border-radius: 12px;
    border: 1px solid #2d2e33;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.auth-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3d30ec;
}

.auth-logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 14px;
    color: #8b8e99;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #d1d4dc;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: #6b7280;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-input-action {
    position: absolute;
    right: 14px;
    color: #6b7280;
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.auth-input-action:hover {
    color: #ffffff;
}

.auth-form-control {
    width: 100%;
    background-color: #131417;
    border: 1px solid #2d2f36;
    color: #ffffff;
    padding: 12px 14px 12px 42px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form-control:focus {
    border-color: #3d30ec;
    box-shadow: 0 0 0 2px rgba(61, 48, 236, 0.25);
}

.auth-form-control::placeholder {
    color: #6b7280;
}

.auth-btn-primary {
    width: 100%;
    background-color: #3d30ec;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
}

.auth-btn-primary:hover {
    background-color: #3125d2;
}

.auth-btn-primary:active {
    transform: scale(0.98);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #6b7280;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #2d2f36;
}

.auth-divider span {
    padding: 0 10px;
}

.auth-social-login {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #131417;
    border: 1px solid #2d2f36;
    color: #ffffff;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.auth-btn-social:hover {
    background-color: #1c1d22;
    border-color: #3d404b;
}

.auth-btn-social svg {
    width: 18px;
    height: 18px;
}

.auth-signup-link {
    text-align: center;
    font-size: 13px;
    color: #8b8e99;
    margin-top: 24px;
}

.auth-signup-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.auth-signup-link a:hover {
    text-decoration: underline;
}

.auth-forgot-password-wrapper {
    text-align: right;
    margin-top: 8px;
}

.auth-forgot-password-link {
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-forgot-password-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Email Sent Card Specific Styles */
.email-sent-card {
    text-align: center;
    padding: 36px 32px;
    max-width: 440px;
}

.illustration-wrapper {
    position: relative;
    width: 140px;
    height: 100px;
    margin: 24px auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illustration-bg {
    position: absolute;
    width: 110px;
    height: 80px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.35));
    border-radius: 28px 40px 30px 24px;
    top: 50%;
    left: 50%;
    transform: translate(-55%, -45%) rotate(-8deg);
    z-index: 1;
}

.envelope-box {
    position: relative;
    z-index: 2;
    width: 90px;
    height: 62px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #6366f1;
}

.envelope-box svg {
    width: 50px;
    height: 50px;
    color: #4f46e5;
}

.send-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    border: 3px solid #1c1d22;
    z-index: 3;
}

.send-badge svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
    transform: translate(1px, -1px);
}

.sparkle {
    position: absolute;
    color: #818cf8;
    font-size: 10px;
    z-index: 3;
}

.email-display {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    word-break: break-all;
    margin: 6px 0 12px;
}

.expire-text {
    font-size: 13px;
    color: #8b8e99;
    margin-bottom: 28px;
}

.btn-back-login {
    display: inline-block;
    width: 100%;
    background-color: #4f46e5;
    color: #ffffff;
    padding: 13px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-back-login:hover {
    background-color: #4338ca;
}

.btn-back-login:active {
    transform: scale(0.98);
}

/* Modal Wrapper */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.2s ease-out;
}

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

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--border-color);
    color: var(--text-light);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-color);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.form-group-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-group-row label {
    margin-bottom: 0;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}
