/* ==========================================
   ULTRA MODERN RESELLER SYSTEM CSS
   Compact & Beautiful Design
========================================== */

/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5b21ff;
    --primary-light: #7c3aed;
    --secondary: #ec4899;
    --dark: #0a0a0a;
    --dark-card: #111111;
    --light: #ffffff;
    --success: #22c55e;
    --warning: #fb923c;
    --danger: #f43f5e;
    --text-muted: #6b7280;
    --border-color: rgba(255, 255, 255, 0.08);
    --glow: 0 0 40px rgba(91, 33, 255, 0.3);
}

/* Base */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--light);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(91, 33, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header - Compact */
.header {
    text-align: center;
    padding: 24px 16px 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: var(--glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: var(--glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(91, 33, 255, 0.5); }
}

.logo i {
    font-size: 24px;
    color: white;
}

h1 {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 900;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(14px, 2vw, 16px);
    color: var(--text-muted);
    max-width: 450px;
    margin: 0 auto;
}

/* Alert */
.alert {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: var(--danger);
    text-align: center;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pricing Section - No extra margin! */
.pricing-section {
    margin-bottom: 8px; /* Minimal margin */
}

.pricing-section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
}

.pricing-section h2 i {
    color: var(--warning);
    margin-right: 8px;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 0; /* No margin bottom */
}

/* Pricing Cards - Ultra Modern */
.pricing-card {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pricing-card:hover::before {
    opacity: 1;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(91, 33, 255, 0.15);
}

.pricing-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(91, 33, 255, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
}

.ribbon {
    position: absolute;
    top: 12px;
    right: -28px;
    background: var(--secondary);
    color: white;
    padding: 2px 35px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(45deg);
}

/* Plan Header */
.plan-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.plan-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.plan-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.plan-price {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Bonus Badge */
.bonus-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.bonus-badge.no-bonus {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

/* Features - Compact */
.features-list {
    list-style: none;
    margin-bottom: 16px;
}

.features-list li {
    padding: 6px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-list i {
    color: var(--success);
    font-size: 10px;
    flex-shrink: 0;
}

/* Select Button */
.select-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.select-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(91, 33, 255, 0.3);
}

.select-btn:active {
    transform: scale(0.98);
}

/* Form Indicator - Minimal */
.form-indicator {
    display: none;
    text-align: center;
    padding: 8px 0;
}

.form-indicator.show {
    display: block;
}

.form-indicator i {
    font-size: 20px;
    color: var(--primary);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Form Section - No extra top margin */
.form-section {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 720px;
    margin: 8px auto 24px; /* Minimal top margin */
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: all 0.3s ease;
    display: none;
}

.form-section.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 800;
}

.selected-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(91, 33, 255, 0.1), rgba(236, 72, 153, 0.1));
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(91, 33, 255, 0.2);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Labels */
label {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

label i {
    width: 14px;
    color: var(--primary);
    margin-right: 4px;
}

/* Inputs */
input,
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(91, 33, 255, 0.1);
}

textarea {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(91, 33, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* Loading */
.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success Page */
.success-container {
    text-align: center;
    padding: 48px 16px;
    max-width: 450px;
    margin: 0 auto;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--success), #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: white;
    box-shadow: 0 16px 32px rgba(34, 197, 94, 0.25);
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.app-id-box {
    background: linear-gradient(135deg, rgba(91, 33, 255, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(91, 33, 255, 0.2);
    padding: 14px 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.app-id {
    font-family: monospace;
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Track Section */
.track-section {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.track-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(91, 33, 255, 0.1);
    font-size: 13px;
}

.track-link:hover {
    background: rgba(91, 33, 255, 0.15);
    transform: translateY(-1px);
}

/* Tracking Container */
.tracking-container,
.ticket-container {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    margin: 32px auto;
}

/* Application/Ticket View */
.app-container {
    max-width: 800px;
    margin: 16px auto;
    padding: 0 16px;
}

.app-card {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
}

.app-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: rgba(251, 146, 60, 0.1);
    color: var(--warning);
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.status-approved {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-rejected {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.info-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

/* Messages */
.messages {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.messages::-webkit-scrollbar {
    width: 4px;
}

.messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.message {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border-left: 3px solid transparent;
    position: relative;
}

.message:first-child {
    background: linear-gradient(135deg, rgba(91, 33, 255, 0.05), rgba(236, 72, 153, 0.03));
    border: 1px solid rgba(91, 33, 255, 0.1);
}

.message.client {
    border-left-color: var(--primary);
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
}

.message.admin {
    border-left-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.message-body {
    line-height: 1.6;
    font-size: 13px;
    word-wrap: break-word;
}

.message-body strong {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Reply Form */
.reply-form {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.reply-form h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.reply-form textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.reply-form textarea:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

/* Fix ticket header spacing */
.app-header h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
}

.app-header p {
    font-size: 13px;
    opacity: 0.8;
}

/* Better info grid */
.info-grid {
    background: rgba(255, 255, 255, 0.01);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-2px);
}

/* Admin Styles */
.admin-header {
    background: var(--dark-card);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.admin-nav h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 800;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-card i {
    font-size: 20px;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 24px;
    font-weight: 900;
    margin: 4px 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 14px;
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 12px;
}

.filter-tab:hover {
    color: white;
    border-color: var(--primary);
    background: rgba(91, 33, 255, 0.1);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
}

/* Table */
.applications-table {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
    border-bottom: none;
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 20px 12px 16px;
    }
    
    .logo {
        width: 48px;
        height: 48px;
    }
    
    .logo i {
        font-size: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pricing-card {
        padding: 16px;
    }
    
    .plan-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .plan-name {
        font-size: 18px;
    }
    
    .plan-price {
        font-size: 24px;
    }
    
    .form-section {
        padding: 20px 16px;
        margin: 8px;
        border-radius: 12px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .app-card {
        padding: 16px;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .message {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .message.client,
    .message.admin {
        margin-left: 8px;
        margin-right: 8px;
        max-width: 100%;
    }
    
    .message-header {
        flex-direction: row;
        gap: 8px;
        font-size: 11px;
    }
    
    .message-body {
        font-size: 12px;
    }
    
    .message-body strong {
        font-size: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    th, td {
        padding: 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 13px;
    }
    
    .pricing-section h2 {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .pricing-card {
        padding: 14px;
    }
    
    .features-list li {
        font-size: 12px;
        padding: 4px 0;
    }
    
    .select-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    input,
    textarea {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .messages {
        max-height: 300px;
    }
}

/* Custom Select Styling */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23999' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select option {
    background: var(--dark-card);
    color: white;
    padding: 8px;
}

/* Fix mobile send button */
@media (max-width: 768px) {
    .reply-form .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}
@media print {
    body {
        background: white;
        color: black;
    }
    
    .pricing-section,
    .form-section,
    .track-section {
        display: none;
    }
}