/* Premium "Creative Box" Design System */

:root {
    --bg-color: #000000;
    --card-bg: #1C1C1E;
    --card-hover: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --accent-blue: #0A84FF;
    --accent-red: #FF453A;
    --border-color: #38383A;
    --nav-bg: rgba(28, 28, 30, 0.85);
    /* Translucent for nav */
    --blur: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation - Floating Pill */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 500px;
    height: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-color);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

/* Hide navbar on desktop (sidebar is always visible) */
@media (min-width: 769px) {
    .navbar {
        display: none;
    }
}

.nav-brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
.content-area {
    padding-top: 140px;
    /* Increased to prevent navbar overlay */
    padding-bottom: 60px;
}

/* App Grid - The "Box" System */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* The Creative Box (Card) */
.app-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    /* Clean look - purely flat/elevated */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.app-card:hover {
    background: var(--card-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Card Header: Icon + Text */
.card-header {
    display: flex;
    align-items: flex-start;
    /* Expand down */
    gap: 16px;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1c1c1e, #2c2c2e);
    /* Placeholder bg */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    /* For images */
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-details {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.app-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
    word-break: break-all;
    /* Prevent long filenames from overflowing */
}

.app-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Card Actions: Footer Row */
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    /* Push to bottom */
}

.btn-install {
    flex: 1;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-blue), #0071e3);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.btn-install:hover {
    background: linear-gradient(135deg, #0071e3, #005bb5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 132, 255, 0.5);
}

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

.btn-delete {
    width: 44px;
    height: 44px;
    background: rgba(255, 69, 58, 0.1);
    color: var(--accent-red);
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(255, 69, 58, 0.2);
    transform: scale(1.05);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

/* Index.html List Links (Compatibility) */
.list-card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.list-card:hover {
    background: var(--card-hover);
    transform: translateX(4px);
}

/* Responsive Overrides */
@media (max-width: 600px) {
    .app-grid {
        grid-template-columns: 1fr;
        /* Full width cards */
    }

    .navbar {
        width: calc(100% - 32px);
        top: 16px;
    }

    .content-area {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================ */
/* PROFILES PAGE STYLES */
/* ============================================ */

.profile-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.profile-card.required {
    border: 2px solid var(--accent-blue);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.05), rgba(10, 132, 255, 0.02));
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.profile-header h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.profile-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.profile-badge.required {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent-blue);
}

.profile-badge.recommended {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.profile-badge.optional {
    background: rgba(142, 142, 147, 0.15);
    color: var(--text-secondary);
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.detail-label {
    color: var(--text-secondary);
    min-width: 90px;
    font-weight: 500;
}

.install-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.install-btn:hover {
    background: #0071e3;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
}

.install-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue), #0071e3);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.info-card {
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.info-card.success {
    background: rgba(76, 175, 80, 0.05);
    border-color: #4CAF50;
}

.info-card.warning {
    background: rgba(255, 159, 10, 0.05);
    border-color: #FF9F0A;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.info-icon {
    font-size: 24px;
}

.info-header h3 {
    font-size: 16px;
    margin: 0;
}

.tech-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.flow-step {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 3px solid var(--accent-blue);
}

.flow-step.result {
    background: rgba(10, 132, 255, 0.1);
    border-color: #4CAF50;
}

.flow-arrow {
    text-align: center;
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: bold;
}

.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.management-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.management-card h4 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.management-steps {
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.management-steps strong {
    color: var(--text-primary);
}

.management-note {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(10, 132, 255, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent-blue);
    font-weight: 500;
}

.shopping-config ul {
    margin-left: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.test-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.test-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.test-number {
    width: 32px;
    height: 32px;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.test-content {
    flex: 1;
}

.test-content strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.test-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.test-result {
    color: var(--accent-blue) !important;
    font-weight: 500;
}

code {
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: #FF9F0A;
}

.guide-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.guide-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 22px;
    margin: 40px 0 12px;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.footnote {
    margin-top: 40px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-left: 3px solid var(--border-color);
}

/* Sidebar styles (if missing) */
.content-with-sidebar {
    padding-top: 100px;
    padding-left: 280px;
    transition: padding-left 0.3s;
}

@media (max-width: 768px) {
    .content-with-sidebar {
        padding-left: 20px;
    }

    .profile-grid,
    .management-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/* HOME PAGE & ACTION CARDS */
/* ============================================ */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.action-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-blue);
}

.action-card.primary {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.05), rgba(10, 132, 255, 0.02));
}

.action-icon {
    font-size: 48px;
}

.action-content h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.action-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.badge-new {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    margin-top: 8px;
}

.manifest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.manifest-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
}

.manifest-card:hover {
    transform: translateX(4px);
    background: var(--card-hover);
}

.cert-name {
    font-weight: 600;
}

.cert-expiry.best {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(10, 132, 255, 0.1);
    color: var(--accent-blue);
    font-weight: 600;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }

    .close-btn {
        display: none;
    }
}

/* ============================================ */
/* CERTIFICATE PAGE IMPROVEMENTS */
/* ============================================ */

.certificate-bundle {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.1), rgba(10, 132, 255, 0.05));
    border: 2px solid var(--accent-blue);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 40px;
}

.bundle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.bundle-header h2 {
    font-size: 24px;
    margin: 0 0 8px 0;
}

.file-size {
    font-size: 14px;
    color: var(--text-secondary);
}

.bundle-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.download-btn-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.download-btn-large:hover {
    background: #0071e3;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.4);
}

.cert-grid-individual {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.cert-card-individual {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.cert-card-individual:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}

.cert-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.cert-icon {
    font-size: 32px;
}

.cert-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px 0;
}

.cert-expiry-badge {
    font-size: 13px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-secondary);
}

.cert-expiry-badge.best {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.cert-expiry-badge.valid {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent-blue);
}

.cert-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cert-download-btn:hover {
    background: #0071e3;
    transform: scale(1.05);
}

/* ============================================ */
/* PORTAL PAGE STYLES */
/* ============================================ */

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.portal-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    cursor: pointer;
}

.portal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-blue);
}

.portal-card.best {
    border-color: #4CAF50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(76, 175, 80, 0.02));
}

.portal-info h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
}

.portal-expiry {
    font-size: 13px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-secondary);
}

.portal-expiry.best {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.portal-expiry.valid {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent-blue);
}

/* ============================================ */
/* LATEST APPS CARDS (HOME PAGE) */
/* ============================================ */

.latest-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.latest-app-card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    cursor: pointer;
}

.latest-app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-blue);
}

.latest-app-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.latest-app-card.disabled:hover {
    transform: none;
    border-color: var(--border-color);
}

.app-preview {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-blue), #0071e3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-letter {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.app-quick-info {
    flex: 1;
}

.app-quick-info h4 {
    font-size: 16px;
    margin: 0 0 6px 0;
}

.app-quick-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.view-badge {
    font-size: 14px;
    color: var(--accent-blue);
    font-weight: 600;
}

/* ============================================ */
/* SETTINGS PAGE */
/* ============================================ */

.settings-section {
    margin-bottom: 40px;
}

.settings-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.setting-item {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.setting-info h3 {
    font-size: 16px;
    margin: 0 0 6px 0;
}

.setting-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.setting-btn {
    padding: 10px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-btn:hover {
    background: #0071e3;
    transform: scale(1.05);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.info-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-badge.online {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.cert-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

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

.about-grid {
    display: grid;
    gap: 12px;
}

.about-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.action-button:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    background: rgba(10, 132, 255, 0.05);
}

code {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.small {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ============================================ */
/* LIGHT THEME SUPPORT */
/* ============================================ */

[data-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --card-bg: #ffffff;
    --card-hover: #f5f5f7;
    --border-color: #d2d2d7;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --accent-blue: #0071e3;
    --blur: 20px;
}

[data-theme="light"] .sidebar {
    background: #f5f5f7;
    border-right-color: #d2d2d7;
}

[data-theme="light"] .guide-step,
[data-theme="light"] .faq-item,
[data-theme="light"] .info-card {
    background: #ffffff;
    border-color: #d2d2d7;
    color: #1d1d1f;
}

[data-theme="light"] .guide-step h3,
[data-theme="light"] .faq-item h3 {
    color: #0071e3;
}

[data-theme="light"] code {
    background: #f5f5f7;
    color: #1d1d1f;
}

/* ============================================ */
/* PREMIUM BUTTON STYLES */
/* ============================================ */

.premium-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--accent-blue), #0077ed);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.5);
    background: linear-gradient(135deg, #0077ed, #005bb5);
}

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

/* Guide Page Premium Redesign */
.guide-section {
    margin-bottom: 48px;
}

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

.guide-header-icon {
    font-size: 32px;
}

.guide-header h2 {
    margin: 0;
    font-size: 24px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue), #0077ed);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.guide-step:hover {
    border-color: var(--accent-blue);
    transform: translateX(4px);
}

.guide-step-content {
    flex: 1;
}

.guide-step h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.guide-step p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-step.success {
    border-color: #34c759;
    background: rgba(52, 199, 89, 0.05);
}

.guide-step.success .step-number {
    background: linear-gradient(135deg, #34c759, #30b350);
}

/* FAQ Premium Styling */
.faq-grid {
    display: grid;
    gap: 20px;
}

.faq-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.faq-item h3 {
    margin: 0 0 16px 0;
    color: var(--accent-blue);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-item h3::before {
    content: "❓";
    font-size: 20px;
}

.faq-item ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.faq-item li {
    padding: 8px 0;
    line-height: 1.6;
    position: relative;
}

.faq-item li::before {
    content: "→";
    color: var(--accent-blue);
    font-weight: bold;
    margin-right: 8px;
}

/* Certificate Status List Premium */
.cert-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.cert-status-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px;
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.cert-status-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.cert-status-card strong {
    font-size: 16px;
    color: var(--text-primary);
}

.cert-status-card span {
    font-size: 13px;
    color: var(--text-secondary);
}

.star-badge {
    font-size: 20px;
}

/* ============================================ */
/* ADMIN DASHBOARD STYLES */
/* ============================================ */

/* Admin specific variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

body[data-theme="light"] {
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.admin-dashboard {
    display: none;
    /* Hidden by default */
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
    animation: fadeIn 0.3s ease;
}

.admin-dashboard.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-container {
    max-width: 100%;
}

/* Control Card */
.control-card {
    background: var(--surface-color);
    background-image: var(--primary-gradient);
    border-radius: 24px;
    padding: 30px;
    color: white;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.control-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 0;
}

.control-content {
    position: relative;
    z-index: 1;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px #4ade80;
}

.current-cert-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.current-cert-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 5px 0 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Certificate Selection Grid (Admin) */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.cert-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.active-card {
    border: 2px solid #4CAF50 !important;
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2);
}

.revoked-card {
    border: 1px solid #f44336;
    opacity: 0.7;
    background: rgba(244, 67, 54, 0.05);
}

.revoked-card .cert-name {
    text-decoration: line-through;
    color: #f44336;
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.cert-badges {
    margin-bottom: 15px;
    min-height: 24px;
}

.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.active-badge {
    background: #4CAF50;
    color: white;
}

.revoked-badge {
    background: #f44336;
    color: white;
}

.cert-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
    transition: transform 0.1s;
}

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

.primary-btn {
    background: var(--primary-gradient);
    color: white;
}

.danger-btn {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid #f44336;
}

.success-btn {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.current-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #4CAF50;
    font-weight: bold;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
}

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

.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid #f44336;
}

/* ============================================ */
/* iOS NATIVE DESIGN SYSTEM */
/* ============================================ */

:root {
    --ios-bg: #000000;
    --ios-card-bg: #1C1C1E;
    --ios-gray: #2C2C2E;
    --ios-blue: #0A84FF;
    --ios-green: #30D158;
    --ios-red: #FF453A;
    --ios-text: #FFFFFF;
    --ios-text-secondary: #8E8E93;
}

body[data-theme="light"] {
    --ios-bg: #F2F2F7;
    --ios-card-bg: #FFFFFF;
    --ios-gray: #E5E5EA;
    --ios-text: #000000;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

/* Card Container */
.ios-card {
    background: var(--ios-card-bg);
    border-radius: 18px;
    padding: 16px;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ios-card:active {
    transform: scale(0.98);
}

.ios-card.active-state {
    border: 1px solid var(--ios-green);
    box-shadow: 0 0 0 1px var(--ios-green), 0 8px 24px rgba(48, 209, 88, 0.2);
}

.ios-card.revoked-state {
    border: 1px solid var(--ios-red);
    opacity: 0.8;
}

/* Header Row */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cert-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cert-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ios-gray);
    font-size: 20px;
}

.active-state .cert-icon {
    background: var(--ios-green);
    color: black;
}

.revoked-state .cert-icon {
    background: var(--ios-red);
    color: white;
}

.cert-details h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--ios-text);
}

.cert-meta {
    font-size: 13px;
    color: var(--ios-text-secondary);
    margin-top: 2px;
}

/* Action Area (Right Side or Bottom) */
.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ios-gray);
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}

.action-btn {
    flex: 1;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--ios-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.install-btn {
    color: var(--ios-blue);
    font-weight: 600;
}

.action-btn.active-btn {
    color: var(--ios-green);
}

.action-btn.revoke-btn {
    color: var(--ios-red);
}

.status-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ios-green);
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    position: absolute;
    top: -6px;
    right: -6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Source Pill */
.source-pill {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Bar Refinement */
.filter-container {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 20px;
}

.search-input {
    background: var(--ios-gray);
    border: none;
    color: var(--ios-text);
}

.filter-select {
    background: var(--ios-gray);
    border: none;
    color: var(--ios-text);
}


/* ============================================ */
/* FILTERS & SORTING */
/* ============================================ */

.filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(30, 30, 40, 0.4);
    padding: 15px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.search-box {
    flex: 2;
    min-width: 200px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
}

.filter-select {
    flex: 1;
    min-width: 140px;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
}

/* ============================================ */
/* PREMIUM NUMBER BADGE */
/* ============================================ */

.cert-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-right: 12px;
    flex-shrink: 0;
}

.cert-number.active {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Help Button */
.help-trigger {
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.help-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ============================================ */
/* STATS DASHBOARD - MINIMAL */
/* ============================================ */

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.stat-card {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

.stat-label {
    font-size: 13px;
    color: var(--ios-text-secondary);
    font-weight: 500;
    text-transform: capitalize;
    margin: 0;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ios-text);
    font-variant-numeric: tabular-nums;
}

.stat-card.success .stat-value {
    color: var(--ios-green);
}

.stat-card.error .stat-value {
    color: var(--ios-red);
}

.stat-card.source .stat-value {
    color: var(--ios-blue);
}

.stat-separator {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
}

.btn-reset-all {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid var(--ios-red);
    color: var(--ios-red);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-all:hover {
    background: var(--ios-red);
    color: white;
}
/* Premium Telegram Bot Button */
.btn-premium-bot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-premium-bot:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.5);
    filter: brightness(1.1);
}

.btn-premium-bot:active {
    transform: scale(0.96);
}

.btn-premium-bot svg {
    width: 18px;
    height: 18px;
    fill: white;
}
