@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Fira+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #020617;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --border-color: rgba(51, 65, 85, 0.5);
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --sidebar-width: 240px;
    --header-height: 64px;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Dashboard Layout */
.dashboard-layout { display: flex; height: 100vh; width: 100vw; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}
.logo { margin-bottom: 2.5rem; padding-left: 0.5rem; }
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.logo i {
    margin-right: 0.75rem;
    color: var(--color-primary);
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}
.nav-item i:not(.fa-lock) { width: 1.25rem; text-align: center; }
.nav-item:hover:not(.nav-item-locked) {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border-color: var(--glass-border);
}
.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    border-color: rgba(59, 130, 246, 0.2);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    left: -1rem;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--color-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
.nav-item-locked { opacity: 0.4; cursor: not-allowed; }

/* Main Content Area */
.main-content {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

/* Header */
.app-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: space-between;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(8px);
}
.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tab-pane { flex: 1; width: 100%; border: none; overflow: hidden; }
.tab-pane iframe { 
    padding: 10px; 
    width: 100%; 
    height: 100%; 
    border: none; 
    background: transparent; 
    display: block;
}
/* Скрытие полос прокрутки для iframe */
.tab-pane iframe::-webkit-scrollbar {
    display: none;
}
.tab-pane iframe {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hidden { display: none !important; }

/* Modals Refined */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
}
.modal-content {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 1100px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }

/* Pricing Cards Refined */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.pricing-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}
.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}
.pricing-card-featured {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.05);
}
.featured-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.price-block { margin-bottom: 1.5rem; }
.old-price { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; margin-bottom: 0.25rem; }
.new-price { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 0.25rem; }

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}
.btn-outline { background: transparent; border: 1.5px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: var(--text-muted); }

.pricing-features { list-style: none; padding: 0; text-align: left; margin-bottom: 1.5rem; flex: 1; }
.pricing-features li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.6rem; line-height: 1.3; }
.pricing-features i { color: var(--color-success); font-size: 0.8rem; margin-top: 0.2rem; }

.tariff-note {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 1rem;
    padding: 1rem;
    text-align: left;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

@media (max-width: 1024px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .sidebar { width: 80px; padding: 1.5rem 0.5rem; align-items: center; }
    .logo span, .nav-item span, .nav-item i.fa-lock, .nav-item i:last-child { display: none; }
    .nav-item { justify-content: center; width: 50px; height: 50px; padding: 0; }
    .nav-item i { margin: 0; font-size: 1.2rem; }
}

@media (max-width: 768px) {
    .sidebar { 
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0 1rem;
        border-right: none;
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
    }
    .logo { display: none; }
    .sidebar-nav { 
        flex-direction: row; 
        width: 100%; 
        justify-content: space-around;
        gap: 0;
    }
    .nav-item { 
        width: auto; 
        height: 100%; 
        border: none;
        background: transparent !important;
    }
    .nav-item.active::after {
        left: 20%;
        bottom: 0;
        top: auto;
        width: 60%;
        height: 3px;
        border-radius: 4px 4px 0 0;
    }
    .main-content { height: calc(100vh - 60px); }
    .app-header { padding: 0 1rem; }
    .tab-pane iframe { padding: 5px; }
    .modal-content { padding: 1.5rem; border-radius: 1rem; }
}

/* Templates Modal Custom Styles */
.templates-modal-content {
    max-width: 900px !important;
    padding: 2.5rem !important;
    background: linear-gradient(145deg, #0f172a 0%, #020617 100%) !important;
}

.templates-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.template-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(30, 41, 59, 0.6);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--border-color);
}

.template-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.copy-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

.copy-btn.copied {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: white !important;
}

.template-body {
    padding: 1.5rem;
}

.template-body pre {
    font-family: 'Fira Sans', sans-serif;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    outline: none;
    border: 1px solid transparent;
}

.template-body pre[contenteditable="true"]:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.template-body pre[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text-main);
}

.template-fill {
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: text;
}

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

.animate-fade-in {
    animation: fade-in 0.5s ease-out;
}

/* GitHub Guide Modal Styling */
.guide-modal-content {
    max-width: 900px !important;
    background: #0a0a0c !important;
    color: #f1f5f9;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    max-height: 90vh !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5) !important;
}

.guide-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, #111116 0%, #0a0a0c 100%);
    padding: 3rem 4rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.guide-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.guide-main-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guide-subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

.guide-container {
    padding: 3rem 4rem;
    overflow-y: auto !important;
    flex: 1;
    overscroll-behavior: contain;
}

/* Make scrollbar visible for the guide specifically */
.guide-container::-webkit-scrollbar {
    display: block !important;
    width: 6px;
}
.guide-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.guide-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}
.guide-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

.guide-section {
    margin-bottom: 4rem;
    position: relative;
}

.section-icon {
    font-size: 2.5rem;
    opacity: 0.1;
    position: absolute;
    top: -1rem;
    left: -2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    padding-left: 0;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1.5rem;
    margin-bottom: 2rem;
}

.bento-item {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.bento-item:hover {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.bento-item h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #3b82f6;
}

.bento-item ul {
    list-style: none;
    padding: 0;
}

.bento-item ul li {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.bento-item p {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
}

.p-1 { grid-column: span 2; }
.p-3 { grid-column: span 2; }

/* Logic Split */
.logic-split {
    display: flex;
    gap: 1rem;
}

.logic-bad, .logic-good {
    flex: 1;
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

.logic-bad h5 { color: #ef4444; font-size: 0.8rem; margin-bottom: 0.5rem; }
.logic-good h5 { color: #10b981; font-size: 0.8rem; margin-bottom: 0.5rem; }
.logic-bad span, .logic-good span { font-size: 0.75rem; color: #64748b; }

/* Readme Block */
.readme-block {
    margin-top: 2rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
}

.readme-block h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.readme-structure {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #3b82f6;
}

.readme-structure span {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

/* Experience List */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exp-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
}

.exp-step {
    font-size: 2rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    font-family: 'Fira Sans', sans-serif;
}

.exp-content h5 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.exp-content p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Footer */
.guide-footer {
    flex-shrink: 0;
    padding: 2rem 4rem 3rem;
    background: #0a0a0c;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.formula-box {
    background: linear-gradient(90deg, #3b82f61a 0%, #10b9811a 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.formula-label {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.formula-value {
    font-family: 'Fira Code', monospace;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .p-1, .p-3 { grid-column: span 1; }
    .guide-header, .guide-container, .guide-footer { padding: 2rem; }
    .guide-main-title { font-size: 1.8rem; }
}

