/* ============================================
   PAKET 03 - FINANCE TOOLS SUITE
   LAYOUT: HEADER + TABS + GRID
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg: #f8fafc;
    --bg-light: #f1f5f9;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --header-bg: #ffffff;
    --footer-bg: #1e293b;
    --footer-text: #94a3b8;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    font-size: 1.2rem;
    white-space: nowrap;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg { width: 18px; height: 18px; }

.header-container nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-container nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-container nav a:hover {
    background: var(--bg-light);
    color: var(--text);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
    flex: 1;
    width: 100%;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2.5rem 20px;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* ============================================
   CATEGORY TABS
   ============================================ */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.category-tabs::-webkit-scrollbar {
    height: 4px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
    flex-shrink: 0;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-tab svg { width: 14px; height: 14px; }

/* ============================================
   CATEGORY GRID
   ============================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: all 0.3s;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
    color: var(--primary);
}

.category-icon svg { width: 22px; height: 22px; }

.category-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.category-card p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ============================================
   TOOLS GRID
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tool-card .tool-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.tool-card .tool-icon svg { width: 20px; height: 20px; }

.tool-card .tool-info { min-width: 0; }

.tool-card .tool-info h3 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card .tool-info p {
    font-size: 0.78rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   TOOL PAGE
   ============================================ */
.tool-page h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tool-intro {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   TOOL BOX
   ============================================ */
.tool-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.tool-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.tool-box textarea:focus,
.tool-box input:focus,
.tool-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tool-box input,
.tool-box select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tool-box label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-light);
}

/* ============================================
   FORM GRID
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    white-space: nowrap;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-copy {
    background: var(--success);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ============================================
   STATS
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 1rem 0;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   OUTPUT BOX
   ============================================ */
.output-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    min-height: 50px;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* ============================================
   CONTENT SECTION
   ============================================ */
.content-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.content-section h3 {
    font-size: 1rem;
    margin: 0.8rem 0 0.4rem;
    font-weight: 600;
}

.content-section p {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.content-section ol,
.content-section ul {
    padding-left: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.content-section li {
    margin-bottom: 0.3rem;
}

/* ============================================
   FAQ
   ============================================ */
.faq-item {
    margin-bottom: 1rem;
}

.faq-item h3 {
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.faq-item p {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ============================================
   RELATED TOOLS
   ============================================ */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.related-tool {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
    transition: all 0.2s;
}

.related-tool:hover {
    border-color: var(--primary);
}

.related-tool svg {
    width: 15px;
    height: 15px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ============================================
   AD CONTAINER
   ============================================ */
.ad-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 20px;
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .header-container nav {
        justify-content: center;
    }
    
    .hero {
        padding: 1.5rem 12px;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card .tool-info p {
        white-space: normal;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.4rem;
    }
    
    .main-content {
        padding: 1rem 12px;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-box {
        padding: 1rem;
    }
    
    .content-section {
        padding: 1rem;
    }
}