/* Template CSS for Credo AI Lab - includes login, sidebar, and common UI styles */

:root {
    --primary-purple: #7B04CA;
    /* French Violet */
    --light-purple: #F2DEFF;
    /* Lavender */
    --background-white: #FBF9FF;
    --text-dark: #161616;
    /* Chin Black */
    --accent-gray: #FBF9FF;
    /* Ghost White */
    --box-shadow: none;
    --template-border: 1px solid #E6E1E5;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --sidebar-width: 260px;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-white);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--light-purple);
    width: var(--sidebar-width);
    min-height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: var(--template-border);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-header a {
    display: block;
    text-decoration: none;
}

/* Logo Styles */
.logo {
    max-width: 100%;
    height: auto;
    display: block;
}

.sidebar-header .logo {
    max-height: 36px;
    margin: 0 auto;
    width: auto;
    object-fit: contain;
}

.login-logo img {
    max-width: 180px;
    height: auto;
    margin: 0 auto;
}

.sidebar ul {
    padding: 20px 0;
    list-style-type: none;
    margin: 0;
}

.sidebar ul li {
    padding: 8px 20px;
}

.sidebar ul li a {
    color: var(--text-dark);
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar ul li a:hover {
    background-color: rgba(123, 4, 202, 0.1);
}

.sidebar ul li.active a {
    background-color: var(--primary-purple);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    font-size: 0.9em;
    color: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.logout-link {
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-link:hover {
    color: var(--primary-purple);
}

/* Content Area */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--accent-gray);
}

.content-section {
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    border: var(--template-border);
    padding: 20px;
    margin-bottom: 20px;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--light-purple);
}

.login-card {
    background-color: white;
    border-radius: var(--border-radius);
    border: var(--template-border);
    padding: 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.login-title {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 600;
}

.login-form {
    text-align: left;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--accent-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 2px rgba(123, 4, 202, 0.2);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.875em;
    color: #6c757d;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background-color: #6503a8;
    /* Darker French Violet */
}

.w-100 {
    width: 100%;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--border-radius);
}

.user-menu-button:hover {
    background-color: var(--accent-gray);
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 45px;
    background-color: white;
    border-radius: var(--border-radius);
    border: var(--template-border);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--text-dark);
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--accent-gray);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--accent-gray);
    margin: 5px 0;
}

/* Utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar .sidebar-header {
        padding: 10px;
    }

    .sidebar ul li a span,
    .sidebar ul li.nav-section,
    .sidebar-footer span {
        display: none;
    }

    .sidebar ul li a i {
        font-size: 1.2em;
    }

    .content {
        margin-left: 60px;
    }
}

@media (max-width: 480px) {
    .login-card {
        margin: 0 20px;
        padding: 20px;
    }

    .login-logo img {
        max-width: 120px;
    }
}