/* Bibbeo Partner Portal - Brand Styles */

:root {
    --color-orange: #F05123;
    --color-blue: #005AAB;
    --color-light-orange: #F79320;
    --color-beige: #E8D9C1;
    --color-teal: #4997AD;
    --color-bg: #f8f9fa;
    --color-text: #333;
    --color-text-muted: #666;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a {
    color: var(--color-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   HEADER - Sticky Navigation
   ======================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo:hover {
    text-decoration: none;
}

.logo-mark {
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.025em;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
}

.nav-item:hover {
    color: #111827;
    background-color: #f3f4f6;
    text-decoration: none;
}

.nav-item.active {
    color: #111827;
    background-color: #f3f4f6;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 2rem;
    height: 2px;
    background: var(--color-orange);
    border-radius: 1px;
}

/* User Section */
.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #f9fafb;
    border-radius: 9999px;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
}

.user-role {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--color-orange);
    background: #fff7ed;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.logout-btn {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
}

.logout-btn:hover {
    color: #111827;
    background-color: #f3f4f6;
    text-decoration: none;
}

/* Legacy badge support */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: var(--color-orange);
    color: white;
}

/* Responsive Header */
@media (max-width: 768px) {
    .header-inner {
        height: auto;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 0.125rem;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-item {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .nav-item.active::after {
        bottom: -0.375rem;
    }

    .header-user {
        margin-left: auto;
    }

    .user-info {
        padding: 0.25rem 0.5rem;
    }

    .user-name {
        font-size: 0.75rem;
    }
}

/* Main Content */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    text-decoration: none;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

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

.btn-primary:hover {
    background: #d94520;
}

.btn-secondary {
    background: var(--color-blue);
    color: white;
}

.btn-secondary:hover {
    background: #004488;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-text-muted);
    color: var(--color-text-muted);
}

.btn-outline:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
}

/* Home Page Hero */
.home-hero {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.home-hero h1 {
    font-size: 2.25rem;
    color: var(--color-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

.home-hero p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.card-link:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    text-decoration: none;
}

.card h2 {
    color: var(--color-blue);
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.card-subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* Card Icons */
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon.inbound {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--color-blue);
}

.card-icon.outbound {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: var(--color-orange);
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

/* Endpoint List */
.endpoint-list {
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
}

.endpoint-list li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid #f0f0f0;
}

.endpoint-list li:last-child {
    border-bottom: none;
}

.endpoint-list code {
    background: #f5f5f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--color-blue);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* Card Action */
.card-action {
    display: inline-block;
    color: var(--color-orange);
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.card-link:hover .card-action {
    text-decoration: underline;
}

/* Info Sections */
.info-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-section h2 {
    color: var(--color-blue);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

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

.step-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.step-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.step-content a {
    color: var(--color-blue);
}

.step-content a:hover {
    text-decoration: underline;
}

/* Activity Grid */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.activity-item {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.activity-item strong {
    display: block;
    color: var(--color-blue);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.activity-item span {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0, 90, 171, 0.1);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.login-container .card {
    padding: 2.5rem;
}

.login-container h1 {
    text-align: center;
    color: var(--color-blue);
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.login-container .btn {
    width: 100%;
    padding: 0.85rem;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
}

th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

td {
    border-bottom: 1px solid #f0f0f0;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #fafafa;
}

/* API Cards */
.api-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.api-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border-left: 4px solid var(--color-orange);
}

.api-card h3 {
    color: var(--color-blue);
    margin-bottom: 0.5rem;
}

.api-card p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

/* Guide Page */
.guide-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
}

.guide-content h1 {
    color: var(--color-blue);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.guide-content h2 {
    color: var(--color-blue);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.guide-content h2:first-of-type {
    border-top: none;
    margin-top: 1.5rem;
}

.guide-content p {
    margin-bottom: 1rem;
    color: var(--color-text);
}

.guide-content ul, .guide-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.guide-content li {
    margin-bottom: 0.5rem;
}

.guide-content code {
    background: #f5f5f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--color-orange);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.guide-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.guide-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Swagger container */
.swagger-container {
    padding: 0;
}

/* Responsive - Content */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .home-hero h1 {
        font-size: 1.75rem;
    }

    .step {
        flex-direction: column;
    }

    .activity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
