/* Layout helpers */
body.home-page,
body.user-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

body.user-page {
    flex-direction: column;
    padding: 2rem 0;
}

body.admin-page {
    background: var(--background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Hide header on home page only */
.home-page header {
    display: none;
}

/* Header styling for user pages (like API Keys) */
.user-page header {
    background: var(--surface);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px var(--shadow);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.user-page header h1 {
    margin: 0;
    font-size: 1.5rem;
    display: inline-block;
    margin-right: 2rem;
}

.user-page header h1 a {
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-page header nav {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.user-page header nav span {
    color: var(--text-secondary);
    font-weight: 500;
}

.user-page header nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.user-page header nav a:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.user-page header nav form {
    display: inline;
}

.user-page header nav button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-page header nav button:hover {
    background: var(--danger-hover);
}

.current-user-indicator {
  color: var(--text-secondary); 
  font-style: italic;
}

/* Main content styling for admin pages */
.admin-page main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1 0 auto; /* Allow main content to grow */
}

/* Footer styling for admin pages */
.admin-page footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto; /* Push footer to the bottom */
}

@media (max-width: 768px) {
    .user-page header {
        padding: 1rem;
    }
    
    .user-page header h1 {
        display: block;
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .user-page header nav {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .admin-page main {
        padding: 1rem;
    }
    
    .admin-page footer {
        padding: 1rem;
    }
}

.container {
    text-align: center;
    background: var(--surface);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px var(--shadow), 0 4px 10px var(--shadow);
    width: 90%;
    max-width: 420px;
    border: 1px solid var(--border);
}

h1 {
    margin-bottom: 2rem;
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2.5rem 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.button:hover {
    background: linear-gradient(135deg, var(--primary-hover), #1e40af);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}

.button:focus {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

.button.google {
    background: linear-gradient(135deg, #4285f4, #3367d6);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
}

.button.google:hover {
    background: linear-gradient(135deg, #3367d6, #2a56c6);
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.4);
}

.button.github {
    background: linear-gradient(135deg, #24292e, #1b1f23);
    box-shadow: 0 4px 12px rgba(36, 41, 46, 0.25);
}

.button.github:hover {
    background: linear-gradient(135deg, #1b1f23, #14171a);
    box-shadow: 0 8px 20px rgba(36, 41, 46, 0.4);
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.link:hover {
    color: var(--primary-hover);
    background: var(--primary-light);
    text-decoration: none;
}

.link.danger {
    color: var(--danger-color);
}

.link.danger:hover {
    color: var(--danger-hover);
    background: rgba(220, 38, 38, 0.1);
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .button {
        width: 100%;
        padding: 1rem;
    }
}

button.link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
}
