/* knobby.io Application Custom Styles */
/* Universal styles for admin, auth, and application pages */
/* Relies on Bootstrap 5.3.8 from static.knobby.io/css/custom.css */

/* ============================================
   COMMON COMPONENTS
   ============================================ */

/* Brand Logo */
.brand-logo {
    width: 40px;
    height: 40px;
    background: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-logo.lg {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
}

.tenant-badge-logo {
    width: 24px;
    height: 24px;
    background: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* ============================================
   ADMIN PAGES
   ============================================ */

.admin-header {
    background: white;
    border-bottom: 1px solid var(--bs-border-color);
}

.admin-nav {
    border-bottom: 2px solid var(--bs-border-color);
}

.admin-nav-link {
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--bs-secondary-color);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
}

.admin-nav-link:hover {
    color: var(--bs-primary);
}

.admin-nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

/* Dashboard Stats - Consistent primary color for enterprise look */
.stat-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.activity-icon {
    width: 36px;
    height: 36px;
    background: var(--bs-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary);
}

/* Settings Layout */
.settings-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
}

.settings-sidebar {
    background: white;
    border-radius: 0;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
}

.settings-content {
    background: white;
    border-radius: 0;
    padding: 2rem;
    border: 1px solid var(--bs-border-color);
}

/* Settings Sidebar Items */
.settings-sidebar-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
}

.settings-sidebar-item:hover {
    background: var(--bs-light);
}

.settings-sidebar-item.active {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.settings-sidebar-item i {
    width: 20px;
    text-align: center;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.section-subtitle {
    color: var(--bs-secondary-color);
    margin-bottom: 2rem;
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.form-help {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Metadata Fields */
.metadata-form-card {
    background: var(--bs-light);
    padding: 1.5rem;
    border-radius: 0;
    margin-bottom: 2rem;
    border: 1px solid var(--bs-border-color);
}

.metadata-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metadata-item {
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    border-radius: 0;
    padding: 1.5rem;
}

.metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.metadata-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.metadata-key {
    font-family: var(--bs-font-monospace);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0;
    font-size: 0.875rem;
    color: var(--bs-primary);
    border: 1px solid var(--bs-border-color);
}

.metadata-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.metadata-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metadata-detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--bs-secondary-color);
    letter-spacing: 0.5px;
}

.metadata-detail-value {
    font-size: 0.875rem;
    color: var(--bs-body-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-secondary-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success);
    border-color: var(--bs-success);
}

.alert-error,
.alert-danger {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}

.alert-warning {
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
    border-color: var(--bs-warning);
}

.alert-info {
    background: var(--bs-info-bg-subtle);
    color: var(--bs-info);
    border-color: var(--bs-info);
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success);
}

.badge.warning {
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
}

/* Users Table - Additional styles */
.user-info-name {
    font-weight: 600;
    color: var(--bs-body-color);
}

.user-info-email {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

/* Role and Status Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.admin {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.role-badge.member {
    background: var(--bs-secondary-bg-subtle);
    color: var(--bs-secondary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success);
}

.status-badge.pending {
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
    background: var(--bs-primary);
    min-height: 100vh;
}

.auth-card {
    animation: slideUp 0.4s ease-out;
}

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

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--bs-border-color);
}

.divider-text {
    background: white;
    padding: 0 1rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    position: relative;
}

.tenant-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    object-fit: cover;
    border: 3px solid white;
}

.tenant-logo-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.radio-label {
    cursor: pointer;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: var(--bs-primary) !important;
    background: var(--bs-light);
}

/* ============================================
   MAIN APPLICATION SHELL (index.html)
   ============================================ */

/* Tenant Switcher & Dropdowns - Consistent styling */
.tenant-logo, .user-avatar {
    background: var(--bs-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.apps-menu-btn, .tenant-switcher-btn, .user-menu-btn {
    background: white;
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    transition: all 0.2s;
}

.apps-menu-btn:hover, .tenant-switcher-btn:hover, .user-menu-btn:hover {
    background: var(--bs-light);
    border-color: var(--bs-primary);
}

.apps-dropdown, .tenant-dropdown {
    background: white;
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--bs-box-shadow);
}

.apps-dropdown-item, .tenant-dropdown-item {
    color: var(--bs-body-color);
    transition: all 0.2s;
}

.apps-dropdown-item:hover, .tenant-dropdown-item:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.apps-dropdown-item.active, .tenant-dropdown-item.active {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

/* Settings Modal */
.settings-modal-content {
    background: white;
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--bs-box-shadow-lg);
}

.settings-tab-btn {
    color: var(--bs-secondary-color);
    border-bottom: 2px solid transparent;
}

.settings-tab-btn:hover {
    color: var(--bs-primary);
}

.settings-tab-btn.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

/* ============================================
   APPLICATION PAGES (Thinker, Strukture, Checklists)
   ============================================ */

/* Add app-specific styles here as needed */
/* These will be consistent with the admin/auth styling */

/* Auth Page Additional Styles */
.icon-badge {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.file-upload-label {
    display: block;
    padding: 1rem;
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.375rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-upload-label:hover {
    border-color: var(--bs-primary);
    background: var(--bs-light);
}

.file-upload-label input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.file-upload-text {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    margin: 1rem auto 0;
    display: block;
    border-radius: 0.375rem;
    border: 1px solid var(--bs-border-color);
}

.info-box {
    padding: 1.5rem;
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.info-box p {
    margin: 0;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
}

.hidden {
    display: none !important;
}

/* Auth step animations and visibility */
.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 1.25rem;
}

.auth-card {
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--bs-box-shadow);
}

/* Spinner for loading states */
.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert styles for errors/success */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
    border: 1px solid var(--bs-danger-border-subtle);
}

.alert-success {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success);
    border: 1px solid var(--bs-success-border-subtle);
}
