/* Purple Hub - Shared Stylesheet */

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

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Auth Header */
.auth-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none; /* Allow clicks to pass through to content below */
}

.auth-header > * {
    pointer-events: auto; /* Re-enable pointer events for child elements */
}

.auth-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.auth-link {
    color: #333;
    text-decoration: none;
    font-weight: 400;
    padding: 8px 16px;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #666;
}

.auth-link-separator {
    color: #999;
}

.logged-in-status {
    color: #333;
    font-weight: 400;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logged-in-status a {
    color: #333;
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 40px;
}

.container.with-auth-header {
    margin-top: 80px; /* Add top margin to prevent overlap with auth header */
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.logo.small {
    width: 60px;
    height: 60px;
}

/* Typography */
h1 {
    font-size: 3em;
    color: #333;
    margin: 0;
    font-weight: 400;
}

h1.medium {
    font-size: 2em;
}

h2 {
    color: #333;
    font-weight: 500;
    margin-bottom: 20px;
}

h3 {
    color: #333;
    font-weight: 500;
    margin-bottom: 15px;
}

h4 {
    color: #333;
    font-weight: 500;
    margin: 0;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.tagline {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
    font-weight: 300;
}

.description {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 50px;
    line-height: 1.8;
}

/* Links */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #333;
    text-decoration: none;
    font-weight: 400;
    padding: 8px 16px;
}

.back-link:hover {
    color: #666;
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: #333;
    color: white;
    text-decoration: none;
    font-weight: 400;
    border: 1px solid #333;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95em;
    box-sizing: border-box;
}

.btn:hover {
    background: #555;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-primary {
    background: #333;
    color: white;
    border-color: #333;
}

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

.btn-secondary {
    background: white;
    color: #333;
    border: 1px solid #ccc;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-full-width {
    width: 100%;
    padding: 12px 30px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #666;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f5f5f5;
    font-weight: 500;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.tab:hover {
    color: #333;
}

.tab.active {
    color: #333;
    border-bottom-color: #333;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Alerts and Info Boxes */
.alert {
    padding: 12px;
    margin-bottom: 20px;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.auth-info {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 30px;
}

.scope-info {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 12px;
    margin: 15px 0;
    font-size: 0.9em;
}

/* Code */
code {
    background: #f5f5f5;
    padding: 2px 6px;
    font-size: 0.9em;
}

pre {
    background: #f5f5f5;
    padding: 15px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
    margin: 10px 0;
}

pre code {
    background: transparent;
    padding: 0;
    font-size: 0.9em;
}

/* Sections */
.section {
    margin-top: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.5em;
}

/* Endpoints (API Docs) */
.endpoint {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

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

.method {
    display: inline-block;
    padding: 4px 8px;
    font-weight: 400;
    font-size: 0.85em;
    margin-right: 10px;
}

.method.post {
    background: #4caf50;
    color: white;
}

.method.get {
    background: #2196f3;
    color: white;
}

.method.put {
    background: #ff9800;
    color: white;
}

.method.delete {
    background: #f44336;
    color: white;
}

.path {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #333;
}

.request-example, .response-example {
    margin-top: 15px;
}

.request-example h4, .response-example h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95em;
    font-weight: 500;
}

.field-list {
    margin-top: 10px;
    padding-left: 20px;
}

.field-list li {
    margin: 5px 0;
}

.required {
    color: #d32f2f;
    font-weight: 500;
}

.optional {
    color: #666;
}

/* Features (Home Page) */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
    text-align: left;
}

.feature {
    padding: 25px;
    background: white;
    border: 1px solid #e0e0e0;
}

.feature h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 500;
}

.feature p {
    color: #666;
    font-size: 0.95em;
}

/* Links Section */
.links {
    margin-top: 50px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Status */
.status {
    margin-top: 30px;
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #e0e0e0;
    max-width: 600px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .container {
        padding: 40px 20px;
    }
    
    .container.with-auth-header {
        margin-top: 70px; /* Adjust for smaller screens */
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .auth-header {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .auth-links {
        justify-content: center;
    }
}
