/* ========================================
   ROES+ Extensions Hub - Main Stylesheet
   Complete Version - All Features
   ======================================== */

:root {
    /* 🎨 COLOR: Muted Teal & Slate (Easy on Eyes) */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-glow: rgba(13, 148, 136, 0.2);
    
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-slider: #f1f5f9;
    --text-main: #374151;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.06);
    
    --radius: 10px;
    --radius-sm: 6px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* ✨ Smooth, Gentle Transition */
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-size-base: 15px;
    --card-min-width: 290px;
    --slider-height: 260px;
    --content-max-width: 1100px;
}

[data-theme="dark"] {
    --bg-body: #111827;
    --bg-card: #1f2937;
    --bg-slider: #1f2937;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #374151;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="cyber"] {
    --bg-body: #0a0a0a;
    --bg-card: #111111;
    --bg-slider: #111111;
    --text-main: #d1d5db;
    --text-muted: #6b7280;    --border: #374151;
    --primary: #14b8a6;
    --primary-hover: #0d9488;
    --primary-glow: rgba(20, 184, 166, 0.15);
}

[data-theme="sunset"] {
    --bg-body: #292524;
    --bg-card: #44403c;
    --bg-slider: #44403c;
    --text-main: #e7e5e4;
    --text-muted: #a8a29e;
    --border: #57534e;
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-glow: rgba(234, 88, 12, 0.2);
}

/* ===== Base Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { 
    font-size: var(--font-size-base); 
    scroll-behavior: smooth; 
}

html.no-animations *, 
html.no-animations *::before, 
html.no-animations *::after { 
    transition: none !important; 
    animation: none !important; 
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Header ===== */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);    padding: 0.875rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(12px);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    letter-spacing: -0.02em;
}

.logo-container:hover { opacity: 0.85; }

.logo-svg { 
    width: 34px; 
    height: 34px; 
    fill: none; 
    stroke: var(--text-main); 
    stroke-width: 2.5; 
    transition: transform 0.5s ease; 
}

.logo-container:hover .logo-svg { transform: rotate(90deg); }

nav ul { 
    display: flex; 
    list-style: none; 
    gap: 1.25rem; 
}

nav a {
    text-decoration: none; 
    color: var(--text-muted);
    font-weight: 500; 
    cursor: pointer;
    padding: 0.45rem 0.7rem; 
    border-radius: var(--radius-sm); 
    position: relative;     transition: var(--transition);
    font-size: 0.92rem;
}

nav a:hover, nav a.active { 
    color: var(--primary); 
    background-color: rgba(13, 148, 136, 0.06); 
}

nav a.active::after {
    content: ''; 
    position: absolute; 
    bottom: -5px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 35%; 
    height: 2px; 
    background: var(--primary); 
    border-radius: 2px;
}

.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

.theme-toggle, .layout-toggle {
    background: var(--bg-body); 
    border: 1px solid var(--border); 
    color: var(--text-main);
    padding: 0.45rem; 
    border-radius: 50%; 
    cursor: pointer; 
    width: 36px; 
    height: 36px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: var(--transition);
}

.theme-toggle:hover, .layout-toggle:hover { 
    transform: scale(1.08); 
    border-color: var(--primary);
    background: rgba(13, 148, 136, 0.06); 
}

/* ===== Main Content ===== */
main {     flex: 1; 
    padding: 2rem 1.5rem; 
    max-width: var(--content-max-width); 
    margin: 0 auto; 
    width: 100%; 
    opacity: 0; 
    transform: translateY(12px); 
    transition: opacity 0.45s ease, transform 0.45s ease; 
}

main.loaded { 
    opacity: 1; 
    transform: translateY(0); 
}

.page-section { display: none; }

.page-section.active { 
    display: block; 
    animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards; 
}

@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(18px); } 
    to { opacity: 1; transform: translateY(0); } 
}

h1 { 
    font-size: 1.85rem; 
    margin-bottom: 0.45rem; 
    color: var(--text-main); 
    font-weight: 650; 
    letter-spacing: -0.025em; 
}

.subtitle { 
    color: var(--text-muted); 
    margin-bottom: 2rem; 
    font-size: 1rem; 
    max-width: 600px; 
    line-height: 1.6; 
}

/* ===== Search Bar ===== */
.search-container {
    margin: 0 auto 2rem auto;
    position: relative;
    max-width: 480px;
    width: 100%;
}
.search-input {
    width: 100%;
    padding: 0.85rem 1.2rem 0.85rem 2.8rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.92rem;
    font-family: var(--font-family);
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 17px;
    height: 17px;
}

/* ===== Ad Slider ===== */
.ad-slider-section {
    background: var(--bg-slider);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2.5rem;
}

.ad-slider-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem; 
    border-bottom: 1px solid var(--border); 
}

.ad-slider-title {     font-weight: 600; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 0.04em; 
}

.ad-slider-indicators { 
    display: flex; 
    gap: 0.35rem; 
}

.slider-dot { 
    width: 7px; 
    height: 7px; 
    border-radius: 50%; 
    background: var(--border); 
    cursor: pointer; 
    transition: var(--transition); 
}

.slider-dot.active { 
    background: var(--primary); 
    transform: scale(1.25); 
}

.ad-slider-container { 
    position: relative; 
    width: 100%; 
    height: var(--slider-height); 
    border-radius: var(--radius-sm); 
    overflow: hidden; 
    background: var(--border); 
    cursor: pointer; 
}

.slider-track { 
    display: flex; 
    height: 100%; 
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1); 
}

.slider-slide { 
    min-width: 100%; 
    height: 100%;
    position: relative; 
}

.slider-slide img { 
    width: 100%;     height: 100%; 
    object-fit: cover; 
    object-position: center; 
    display: block; 
    transition: filter 0.35s ease; 
}

.slider-overlay-text { 
    position: absolute; 
    bottom: 1.25rem; 
    left: 1.25rem; 
    color: white; 
    font-weight: 500; 
    font-size: 1rem; 
    text-shadow: 0 2px 6px rgba(0,0,0,0.35); 
    pointer-events: none; 
    background: rgba(0,0,0,0.25); 
    padding: 0.35rem 0.7rem; 
    border-radius: 4px; 
    backdrop-filter: blur(3px); 
}

.slider-arrow { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 38px; 
    height: 38px; 
    border-radius: 50%; 
    background: rgba(255,255,255,0.85); 
    border: none; 
    color: var(--text-main); 
    font-size: 1.1rem; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 10; 
    transition: var(--transition); 
    opacity: 0; 
}

.ad-slider-container:hover .slider-arrow { opacity: 1; }

.slider-arrow:hover {
    background: white; 
    transform: translateY(-50%) scale(1.06); 
}

[data-theme="dark"] .slider-arrow {     background: rgba(31,41,55,0.85); 
    color: white; 
}

.slider-arrow.prev { left: 0.875rem; }
.slider-arrow.next { right: 0.875rem; }

.slider-progress { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    height: 2.5px; 
    background: var(--primary); 
    z-index: 5; 
    transition: width 0.1s linear; 
}

/* ===== Grid & Cards ===== */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr)); 
    gap: 1.75rem; 
}

.grid.layout-horizontal { grid-template-columns: 1fr; }

.grid.layout-horizontal .card { 
    flex-direction: row; 
    height: 200px; 
}

.grid.layout-horizontal .card-img-wrapper { 
    width: 280px; 
    height: 100%; 
    flex-shrink: 0; 
}

.grid.layout-horizontal .card-body { 
    padding: 1.25rem 1.75rem; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.grid.layout-horizontal .btn {
    max-width: 140px; 
    align-self: flex-start; 
}

.card {    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    user-select: none; 
    -webkit-user-select: none;
}

.card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-lg); 
    border-color: var(--primary); 
}

.card::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 2.5px; 
    background: var(--primary); 
    opacity: 0; 
    transition: var(--transition); 
}

.card:hover::before { opacity: 1; }

.card-img-wrapper {
    height: 185px;
    width: 100%;
    background-color: var(--border);
    overflow: hidden;
    position: relative;
}

.card-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    object-position: center; 
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.35s ease; 
    display: block; 
}
.card:hover .card-img { transform: scale(1.04); }

.theme-overlay { 
    position: absolute; 
    inset: 0; 
    pointer-events: none; 
    opacity: 0.08; 
}

[data-theme="dark"] .theme-overlay { 
    background: linear-gradient(135deg, rgba(31,41,55,0.35), transparent); 
}

[data-theme="cyber"] .theme-overlay { 
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), transparent); 
    opacity: 0.12; 
}

[data-theme="sunset"] .theme-overlay { 
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), transparent); 
    opacity: 0.15; 
}

.card-body { 
    padding: 1.125rem 1.375rem; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
}

.card-title { 
    font-weight: 600; 
    font-size: 1.08rem; 
    color: var(--text-main); 
    margin-bottom: 0.45rem; 
    line-height: 1.3; 
}

.card:hover .card-title { color: var(--primary); }

.card-desc { 
    font-size: 0.88rem; 
    color: var(--text-muted); 
    margin-bottom: 1.125rem; 
    flex-grow: 1;
    line-height: 1.5; 
}

.btn {
    display: inline-flex;     justify-content: center; 
    align-items: center;
    background-color: var(--primary); 
    color: white;
    padding: 0.65rem 1.125rem; 
    border-radius: var(--radius-sm);
    text-decoration: none; 
    font-weight: 500; 
    border: none;
    cursor: pointer; 
    width: 100%; 
    gap: 6px;
    transition: var(--transition); 
    font-size: 0.88rem;
}

.btn:hover { 
    background-color: var(--primary-hover); 
    transform: translateY(-1.5px); 
}

.btn:active { transform: translateY(0); }

.btn:disabled { 
    opacity: 0.55; 
    cursor: not-allowed; 
    transform: none !important; 
}

.btn-outline { 
    background-color: transparent; 
    border: 1px solid var(--border); 
    color: var(--text-main); 
}

.btn-outline:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
    background: rgba(13, 148, 136, 0.04); 
}

/* ===== Status Badges (Horizontal - Top Right) ===== */
.status-badges-container {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;    z-index: 3;
    pointer-events: none;
    justify-content: flex-end;
    max-width: calc(100% - 1.2rem);
}

.status-badge {
    position: relative;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
    color: white;
    animation: badgeFadeIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(-3px);
}

@keyframes badgeFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.status-badges-container .status-badge:nth-child(1) { animation-delay: 0.03s; }
.status-badges-container .status-badge:nth-child(2) { animation-delay: 0.06s; }
.status-badges-container .status-badge:nth-child(3) { animation-delay: 0.09s; }
.status-badges-container .status-badge:nth-child(n+4) { display: none; }

/* Status Badge Colors */
.status-free { background: linear-gradient(135deg, #10b981, #059669); }
.status-unsandboxed { background: linear-gradient(135deg, #ef4444, #dc2626); }
.status-sandboxed { background: linear-gradient(135deg, #34d399, #10b981); }
.status-premium { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.status-new { background: linear-gradient(135deg, #38bdf8, #0ea5e9); animation: badgePulse 2s ease-in-out infinite, badgeFadeIn 0.3s ease forwards; }
.status-updated { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.status-verified { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.status-beta { background: linear-gradient(135deg, #f97316, #ea580c); }
.status-popular { background: linear-gradient(135deg, #ec4899, #db2777); }
.status-deprecated { background: linear-gradient(135deg, #78716c, #57534e); }
.status-exclusive { background: linear-gradient(135deg, #1e293b, #0f172a); border: 1px solid #475569; }
.status-opensource { background: linear-gradient(135deg, #8b5cf6, #a855f7); }

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 2px 10px rgba(56, 189, 248, 0.5); }
}
/* ===== Full Page Preview ===== */
#preview-page { display: none; animation: fadeIn 0.4s ease; }
#preview-page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.preview-back-btn {
    display: inline-flex; 
    align-items: center; 
    gap: 0.45rem;
    color: var(--text-muted); 
    text-decoration: none;
    margin-bottom: 1.25rem; 
    font-weight: 500;
    cursor: pointer; 
    transition: var(--transition);
    font-size: 0.88rem;
}

.preview-back-btn:hover { 
    color: var(--primary); 
    transform: translateX(-4px); 
}

.preview-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.75rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.preview-hero-img-wrapper {
    width: 100%;
    height: 320px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.preview-hero-img {
    width: 100%; 
    height: 100%; 
    object-fit: contain;
    object-position: center;
    display: block;     transition: filter 0.35s ease;
    background: var(--bg-slider);
}

.preview-hero-content {
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.preview-hero-title {
    font-size: 1.65rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 650;
}

.preview-hero-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 580px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.download-timer-box {
    background: var(--bg-slider);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
}

.timer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.countdown-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 1rem;    line-height: 1;
}

/* ===== How To Use Page ===== */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
    margin-top: 1.75rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.375rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.step-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--border);
    opacity: 0.45;
    line-height: 1;
}

.step-img {
    width: 100%;
    height: 145px;
    background: var(--bg-slider);
    border-radius: var(--radius-sm);
    margin-bottom: 0.875rem;
    object-fit: cover;
    border: 1px solid var(--border);
}

.step-title {    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
}

.step-desc {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Settings ===== */
.settings-container { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    padding: 1.375rem; 
    margin-bottom: 1.75rem; 
}

.settings-section { 
    margin-bottom: 1.5rem; 
    padding-bottom: 1.375rem; 
    border-bottom: 1px solid var(--border); 
}

.settings-section:last-child { 
    border-bottom: none; 
    margin-bottom: 0; 
    padding-bottom: 0; 
}

.settings-section h3 { 
    font-size: 1rem; 
    margin-bottom: 0.875rem; 
    color: var(--text-main); 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.04em; 
}

.setting-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0.875rem 0; 
    border-bottom: 1px solid var(--border); 
}
.setting-row:last-child { 
    border-bottom: none; 
    padding-bottom: 0; 
}

.setting-info h4 { 
    color: var(--text-main); 
    font-size: 0.95rem;
    margin-bottom: 0.2rem; 
    font-weight: 500; 
}

.setting-info p { 
    color: var(--text-muted); 
    font-size: 0.82rem; 
}

.switch { 
    position: relative; 
    display: inline-block; 
    width: 46px; 
    height: 24px; 
}

.switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.slider { 
    position: absolute; 
    cursor: pointer; 
    inset: 0; 
    background-color: var(--border); 
    transition: .25s; 
    border-radius: 34px; 
}

.slider:before { 
    position: absolute; 
    content: ""; 
    height: 18px; 
    width: 18px; 
    left: 3px; 
    bottom: 3px; 
    background-color: white; 
    transition: .25s; 
    border-radius: 50%; 
    box-shadow: 0 1.5px 3px rgba(0,0,0,0.08); }

input:checked + .slider { background-color: var(--primary); }

input:checked + .slider:before { transform: translateX(22px); }

.range-control { 
    display: flex;
    align-items: center; 
    gap: 0.875rem; 
    width: 170px; 
}

.range-control input[type="range"] { 
    flex: 1; 
    height: 3.5px; 
    border-radius: 2px; 
    background: var(--border); 
    outline: none; 
}

.range-control input[type="range"]::-webkit-slider-thumb { 
    -webkit-appearance: none;
    width: 15px; 
    height: 15px; 
    border-radius: 50%; 
    background: var(--primary); 
    cursor: pointer; 
    transition: var(--transition); 
}

.range-control input[type="range"]::-webkit-slider-thumb:hover { 
    transform: scale(1.15); 
}

.range-value { 
    min-width: 38px; 
    text-align: center; 
    font-weight: 600; 
    color: var(--primary); 
    background: var(--bg-slider); 
    padding: 0.18rem 0.45rem; 
    border-radius: 4px; 
    font-size: 0.82rem; 
}

.theme-selector { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); 
    gap: 0.625rem;     margin-top: 0.625rem; 
}

.theme-option { 
    background: var(--bg-body); 
    border: 1px solid var(--border); 
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.45rem; 
    text-align: center; 
    cursor: pointer; 
    transition: var(--transition); 
    position: relative; 
}

.theme-option:hover { 
    border-color: var(--primary); 
    transform: translateY(-1.5px); 
}

.theme-option.active { 
    border-color: var(--primary); 
    background: rgba(13, 148, 136, 0.04); 
}

.theme-option::after { 
    content: ''; 
    position: absolute; 
    top: 4px; 
    right: 4px; 
    width: 7px; 
    height: 7px; 
    background: var(--primary); 
    border-radius: 50%; 
    opacity: 0; 
}

.theme-option.active::after { opacity: 1; }

.theme-preview { 
    width: 100%; 
    height: 36px; 
    border-radius: 4px; 
    margin-bottom: 0.45rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 600; 
    font-size: 0.68rem; 
    color: white; 
}
.theme-light .theme-preview { 
    background: linear-gradient(135deg, #f8fafc, #e2e8f0); 
    color: #374151; 
}

.theme-dark .theme-preview {
    background: linear-gradient(135deg, #111827, #1f2937); 
}

.theme-cyber .theme-preview { 
    background: linear-gradient(135deg, #0a0a0a, #111111); 
    color: #14b8a6; 
}

.theme-sunset .theme-preview { 
    background: linear-gradient(135deg, #292524, #44403c); 
    color: #ea580c; 
}

.theme-label { 
    font-size: 0.78rem; 
    font-weight: 500; 
    color: var(--text-main); 
}

/* ===== Connect ===== */
.connect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));  /* ✅ زادنا من 190px */
    gap: 1.5rem;  /* ✅ زادنا من 1.375rem */
    margin-top: 1.375rem;
}

.connect-card {
    background: var(--bg-card);
    padding: 1.75rem 1.25rem;  /* ✅ زادنا padding من 1.75rem */
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;  /* ✅ زادنا من 165px إلى 180px */
}

.connect-card:hover {     border-color: var(--primary); 
    background: rgba(13, 148, 136, 0.025); 
    transform: translateY(-4px); 
}

.connect-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-slider);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
    transition: var(--transition);
}

.connect-card:hover .connect-icon-wrapper {
    background: rgba(13, 148, 136, 0.08);
    transform: scale(1.05);
}

.connect-icon-svg {
    width: 32px;
    height: 32px;
    stroke: var(--text-main);
    fill: none;
    stroke-width: 1.5;
    transition: var(--transition);
}

.connect-card:hover .connect-icon-svg {
    stroke: var(--primary);
}

.connect-card:hover .connect-icon-svg {
    stroke: var(--primary);
    transform: scale(1.08);
}

.connect-icon-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.connect-icon-placeholder svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}



.connect-sub { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    margin-top: 0.4rem; 
}

.connect-logo-container {
    margin: 1.75rem auto;
    text-align: center;
    opacity: 0.75;
    transition: var(--transition);
}

.connect-logo-container:hover { 
    opacity: 1; 
    transform: scale(1.04); 
}

.connect-logo-svg {
    width: 65px; 
    height: 65px;
    stroke: var(--primary);
    stroke-width: 2;
    fill: none;
}

/* ===== ROBuilder Page (NEW) ===== */
.robuilder-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
}

.robuilder-logo {
    width: 70px;
    height: 70px;
    animation: robuilderFloat 3s ease-in-out infinite;
}

@keyframes robuilderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
/* ===== Toast ===== */
#toast-container {
    position: fixed; 
    bottom: 1.375rem; 
    right: 1.375rem; 
    z-index: 3000; 
    display: flex; 
    flex-direction: column; 
    gap: 0.625rem; 
}

.toast {
    background: var(--bg-card); 
    color: var(--text-main);
    padding: 0.75rem 1.125rem; 
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); 
    border-left: 2.5px solid var(--primary);
    display: flex; 
    align-items: center; 
    gap: 0.625rem;
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    min-width: 260px; 
    max-width: 360px; 
    font-weight: 500; 
    font-size: 0.88rem; 
    cursor: pointer;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

@keyframes slideIn { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

.toast.hide { animation: slideOut 0.25s ease-in forwards; }

@keyframes slideOut { 
    to { transform: translateX(100%); opacity: 0; } 
}

/* ===== Footer ===== */
footer { 
    background: var(--bg-card); 
    border-top: 1px solid var(--border); 
    padding: 1.25rem 1.5rem; 
    text-align: center;     color: var(--text-muted); 
    margin-top: auto;
    font-size: 0.82rem; 
}

footer a { 
    color: var(--primary); 
    text-decoration: none; 
}

footer a:hover { text-decoration: underline; }

/* ===== Loading ===== */
.loading-placeholder { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); 
    gap: 1.75rem; 
}

.loading-card { 
    background: var(--bg-card); 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    height: 290px; 
    animation: pulse 1.5s infinite ease-in-out; 
}

@keyframes pulse { 
    0%, 100% { opacity: 1; } 
    50% { opacity: 0.55; } 
}

.loading-img { height: 185px; background: var(--border); }

.loading-content { padding: 1.125rem; }

.loading-title { 
    height: 18px; 
    background: var(--border); 
    border-radius: 4px; 
    margin-bottom: 0.5rem; 
    width: 70%; 
}

.loading-desc { 
    height: 13px; 
    background: var(--border); 
    border-radius: 4px; 
    margin-bottom: 0.35rem;     width: 88%; 
}

.loading-btn { 
    height: 38px; 
    background: var(--border); 
    border-radius: var(--radius-sm); 
    margin-top: 0.625rem; 
    width: 100%; 
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header { 
        flex-direction: column; 
        gap: 0.875rem; 
        padding: 0.875rem 1rem; 
    }
    
    nav ul { 
        gap: 0.45rem; 
        flex-wrap: wrap; 
        justify-content: center; 
    }
    
    .grid { grid-template-columns: 1fr; }
    
    h1 { font-size: 1.65rem; }
    
    :root { --slider-height: 200px; }
    
    .preview-hero-img-wrapper { height: 220px; }
    
    .grid.layout-horizontal .card { 
        flex-direction: column; 
        height: auto; 
    }
    
    .grid.layout-horizontal .card-img-wrapper { 
        width: 100%; 
        height: 185px; 
    }
    
    .grid.layout-horizontal .btn { max-width: 100%; }
    
    .robuilder-logo { width: 200px; height: 200px; }
    
    .connect-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
/* ===== Print Styles ===== */
@media print {
    header, footer, .ad-slider-section, .theme-toggle, .layout-toggle, .btn, #toast-container {
        display: none !important;
    }
    
    body { 
        background: white !important; 
        color: black !important; 
    }
    
    .card { 
        break-inside: avoid; 
        box-shadow: none !important; 
        border: 1px solid #ccc !important; 
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

button:focus-visible, 
a:focus-visible, 
.theme-option:focus-visible,
.slider-dot:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}