/* ========================================
   UnifiedPay API Platform - Main Stylesheet
   Colors: Modern, earthy green & warm accent
   Professional, responsive, accessible.
   ======================================== */

/* ---------- CSS Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root Variables - Design System */
:root {
    --primary: #2f6b2f;
    --primary-dark: #1f4f1f;
    --accent: #c47e2e;
    --light-bg: #fefcf7;
    --card-bg: #ffffff;
    --border-light: #e9e5dc;
    --text-dark: #2c2b28;
    --text-muted: #6b6b64;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.04);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 40px;
    --transition: all 0.25s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.5;
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, .logo {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Links & Buttons */
a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn-primary,
.btn-outline,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-light);
    color: var(--text-dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(47, 107, 47, 0.04);
    color: var(--primary);
}

.btn-danger {
    background: #d9534f;
    color: white;
    padding: 8px 20px;
    font-size: 0.85rem;
}

.btn-danger:hover {
    background: #c9302c;
    transform: translateY(-1px);
}

/* Header & Navigation */
header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.96);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 2rem;
}

.logo a {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.logo a span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.nav-links li a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 0;
}

.nav-links li a:hover {
    color: var(--primary);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.hamburger span {
    width: 26px;
    height: 2px;
    background: var(--text-dark);
    transition: var(--transition);
    border-radius: 4px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background: var(--card-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-md);
        transition: 0.3s ease;
        z-index: 99;
        border-right: 1px solid var(--border-light);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links li a {
        display: block;
        width: 100%;
        padding: 12px 0;
        font-size: 1.1rem;
    }
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
}

.hero-grid {
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
}

.hero-content span {
    background: #e7e1d2;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-dark);
}

.hero-content h1 {
    font-size: 3.8rem;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 90%;
    margin: 1.5rem 0;
}

.hero-content .btn-primary,
.hero-content .btn-outline {
    margin-top: 0.5rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.hero-stats h3 {
    font-size: 2rem;
    margin-bottom: 0;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 900px) {
    .hero-grid {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content p {
        max-width: 100%;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}

/* Features & Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.account-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.account-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.account-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.account-card code {
    display: block;
    background: var(--light-bg);
    padding: 8px 12px;
    border-radius: 12px;
    margin-top: 1rem;
    font-size: 0.75rem;
    word-break: break-all;
}

/* Forms */
.form-container {
    max-width: 520px;
    margin: 3rem auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light-bg);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 47, 0.1);
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: #ffe6e5;
    border-left: 4px solid #d9534f;
    color: #b52b27;
}

.alert-success {
    background: #e0f2e0;
    border-left: 4px solid var(--primary);
    color: #1f4f1f;
}

/* Footer */
footer {
    background: #1e2a1c;
    color: #fff;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

footer h3 {
    color: white;
    margin-bottom: 0.5rem;
}

footer p {
    color: #cfd8cf;
}

.social-icons i {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: #cfd8cf;
    transition: var(--transition);
    cursor: pointer;
}

.social-icons i:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* How It Works Page */
.process-container {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 24px;
}

.step-card {
    display: flex;
    gap: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.step-number {
    background: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 60px;
    font-size: 1.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.flow-arrow {
    text-align: center;
    font-size: 2rem;
    color: var(--primary);
    margin: 0.5rem 0;
}

.integration-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0;
}

.flow-box {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    flex: 1;
    text-align: center;
    border: 1px solid var(--border-light);
}

.code-snippet-mini,
.code-block {
    background: #1e2a1c;
    color: #cde2cd;
    padding: 1rem;
    border-radius: 16px;
    font-family: monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

.code-block pre {
    color: inherit;
    font-family: monospace;
}

@media (max-width: 700px) {
    .step-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .integration-flow {
        flex-direction: column;
    }
}

/* API Docs Page */
.docs-container {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 24px;
}

.endpoint {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.method-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-right: 12px;
}

.url-path {
    background: var(--light-bg);
    padding: 10px 16px;
    border-radius: 40px;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 1rem 0;
    border: 1px solid var(--border-light);
    display: inline-block;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.param-table th,
.param-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.response-example {
    background: #f8f6f0;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.tab-container {
    margin: 1.5rem 0;
}

.tab-buttons {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 18px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 40px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.error-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin: 1rem 0;
}

.error-item {
    background: var(--light-bg);
    padding: 8px 12px;
    border-radius: 40px;
    font-size: 0.85rem;
}

/* Dashboard specific */
.badge {
    background: var(--primary);
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* CTA Section */
.cta-gradient {
    background: linear-gradient(135deg, #2c482c, #1f4f1f);
    padding: 3rem;
    border-radius: var(--radius-lg);
    color: white;
    text-align: center;
}

.cta-gradient h2,
.cta-gradient p {
    color: white;
}

.cta-gradient .btn-primary {
    background: white;
    color: var(--primary);
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* Invisible elements: focus outlines, accessibility */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive global tweaks */
@media (max-width: 640px) {
    .container {
        padding: 0 20px;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .account-card {
        padding: 1.5rem;
    }
}

/* Ensure tables and code are responsive */
pre, code {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', monospace;
}

img {
    max-width: 100%;
    height: auto;
}

/* custom inline fix: for dashboard grid etc */
.dashboard-grid .account-card i {
    font-size: 2.2rem;
}