/* Home Page Specific Styles */
:root {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #252525;
    --bg-card-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-primary: #bb86fc;
    --accent-secondary: #03dac6;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

/* Page layout */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* Header Styles */
header {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Hamburger menu for mobile */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Hamburger animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Desktop styles for nav-menu links */
.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(187, 134, 252, 0.2), transparent);
    transition: var(--transition);
}

.nav-menu a:hover::before {
    left: 100%;
}

.nav-menu a:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
}

/* Mobile menu styles */
@media (max-width: 768px) {
    /* Header layout */
    header {
        padding: 1rem;
    }
    
    nav {
        position: relative;
        display: flex;
        justify-content: space-between;  /* This ensures logo is on left and hamburger is on right */
        align-items: center;
    }
    
    .logo {
        font-size: 1.5rem;
        order: 1;
        margin-right: auto;  /* Ensure logo stays on the left */
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 280px;
        background-color: var(--bg-secondary);
        flex-direction: column;
        text-align: left;
        transition: 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        padding: 70px 2rem 2rem 2rem;
        z-index: 1000;
        overflow-y: auto;
        display: flex !important;  /* Override desktop display setting */
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
    }
    
    .hamburger {
        display: flex !important;  /* Override desktop display setting */
        z-index: 1001;
        order: 2;  /* Ensure hamburger stays on the right */
        cursor: pointer;
    }
    
    .hamburger span {
        width: 25px;
        height: 3px;
        background: var(--text-primary);
        margin: 3px 0;
        transition: 0.3s;
        border-radius: 2px;
    }
    
    .language-selector {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    .language-selector select {
        width: 100%;
        padding: 0.7rem;
    }
    
    /* Ensure desktop menu is hidden on mobile */
    .nav-menu:not(.active) {
        display: none;
    }
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-primary);
    transition: var(--transition);
}

.logo:hover {
    color: var(--accent-secondary);
    transform: scale(1.05);
}

.language-selector select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    animation: fadeInUp 1s ease;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Additional styles for API cards */
.api-cards-section {
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 1rem;
}

.api-cards-section h2 {
    color: var(--accent-primary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

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

/* On medium screens */
@media (min-width: 769px) and (max-width: 1199px) {
    .api-cards {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* On large screens */
@media (min-width: 1200px) {
    .api-cards {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

/* On small screens, show at least 1 column but allow more if space permits */
@media (max-width: 768px) {
    .api-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.api-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.5s ease, float 3s ease-in-out infinite;
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(187, 134, 252, 0.1), transparent);
    transition: var(--transition);
    z-index: 1;
}

.api-card:hover::before {
    left: 100%;
}

.api-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
    animation: glow 2s infinite;
}

.api-card h3 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    position: relative;
    z-index: 2;
}

.api-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.method {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.get { background: #4caf50; color: white; }
.post { background: #2196f3; color: white; }
.put { background: #ff9800; color: white; }
.delete { background: #f44336; color: white; }

.endpoint {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: block;
    position: relative;
    z-index: 2;
}

/* API Detail Page */
.api-detail-page {
    max-width: 800px;
    margin: 0 auto;
}

.api-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    animation: fadeIn 1s ease;
}

.api-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.api-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    animation: slideIn 0.5s ease;
}

.detail-card h2 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.endpoint-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.endpoint-url {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: monospace;
    flex: 1;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

footer p {
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(187, 134, 252, 0.5); }
    50% { box-shadow: 0 0 20px rgba(187, 134, 252, 0.8); }
    100% { box-shadow: 0 0 5px rgba(187, 134, 252, 0.5); }
}

/* Enhanced animations */
.nav-links a {
    animation: pulse 2s infinite;
}

.nav-links a:hover {
    animation: none;
}

.method {
    animation: pulse 2s infinite;
}

.method:hover {
    animation: none;
    transform: scale(1.1);
}

.logo {
    animation: float 4s ease-in-out infinite;
}

.logo:hover {
    animation: none;
}

/* Additional animation classes */
.animated-hover {
    animation: pulse 0.5s ease, glow 1.5s ease;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #d6e2ff;
}

.json-string {
    color: #a5e885;
}

.json-number {
    color: #8ae9fc;
}

.json-boolean {
    color: #ff9d5d;
}

.json-null {
    color: #ff6db6;
}

/* Copy button styles */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.response-container:hover .copy-btn {
    opacity: 1;
}

/* Extra small devices (phones, 480px and below) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.7rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .api-cards-section h2 {
        font-size: 1.3rem;
    }
    
    .detail-card h2 {
        font-size: 1.1rem;
    }
    
    .language-selector select {
        font-size: 0.8rem;
        padding: 0.3rem;
    }
}