/* =============================================================================
   Mingo - header-nav.css
   Header, navigation, buttons, forms
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Header Component
   ----------------------------------------------------------------------------- */
   .header {
    background: linear-gradient(135deg, var(--ios-blue) 0%, #1557b0 100%);
    color: white;
    margin-top: env(safe-area-inset-top, 0px);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    border-bottom: 0.5px solid rgba(255,255,255,0.2);
    flex-wrap: nowrap;
}

/* App Logo */
.app-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.app-logo:hover {
    transform: scale(1.1);
}

.app-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Header Title */
.header-title {
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.45px;
    line-height: 1.2;
    color: white;
}

.header-title p {
    font-size: 14px;
    margin: 0;
    line-height: 1.2;
    color: white;
    opacity: 0.9;
}

/* User Avatar */
.user-avatar-compact {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: white;
}

.user-avatar-compact:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.user-avatar-compact:active {
    transform: scale(0.95);
}

/* Sign Out Button */
.sign-out-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.sign-out-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sign-out-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sign-out-btn:active {
    transform: scale(0.95);
}

/* Auth Logo */
.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* User Info Popover */
.user-info-popover {
    position: absolute;
    top: 60px;
    right: 20px;
    background: var(--ios-secondary-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--ios-shadow-heavy);
    z-index: 1000;
    display: none;
    min-width: 200px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
}

.user-info-popover.visible {
    display: block;
    animation: popoverAppear 0.3s ease-out;
}

@keyframes popoverAppear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-info-popover p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.user-info-popover small {
    color: var(--text-secondary);
    font-size: 12px;
}

.user-info-popover-signout {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 8px;
}

.user-info-popover-signout button {
    flex: 1;
    padding: 8px 12px;
    background: var(--ios-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.user-info-popover-signout button:hover {
    background: #0051D5;
}

.user-info-popover-signout button:active {
    transform: scale(0.95);
}

/* -----------------------------------------------------------------------------
   Navigation Components
   ----------------------------------------------------------------------------- */

/* Desktop Tabs */
.tabs {
    display: flex;
    background: var(--ios-secondary-background);
    border-radius: var(--ios-radius-large);
    padding: 4px;
    margin-bottom: 2rem;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    box-shadow: var(--ios-shadow-light);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--ios-radius-medium);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    flex: 1;
    text-align: center;
    min-width: 120px;
    letter-spacing: -0.32px;
}

.tab:hover {
    color: var(--ios-blue);
    background: rgba(0, 122, 255, 0.05);
}

.tab.active {
    color: var(--ios-blue);
    background: rgba(0, 122, 255, 0.1);
    box-shadow: var(--ios-shadow-light);
}

.tab-content {
    display: none;
    width: 100%;
}

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

/* Add a loading state for the app screen */
.app-screen.loading .tab-content {
    display: none !important;
}

/* Mobile Bottom Tab Navigation */
.mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding-top: 8px;
    /* Add safe area inset for PWA mode (home indicator on iOS) */
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: none;
    z-index: 1000;
}

.mobile-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    min-width: 60px;
    background: none;
    border: none;
    color: var(--text-secondary);
}

.mobile-tab.active {
    color: var(--ios-blue);
}

.mobile-tab:active {
    transform: scale(0.95);
    background: rgba(0, 122, 255, 0.1);
}

.mobile-tab-icon {
    width: 24px;
    height: 24px;
}

.mobile-tab-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.24px;
}

/* -----------------------------------------------------------------------------
   Button Components
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ios-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--ios-radius-medium);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
    line-height: 1.2;
    min-height: 44px;
    box-shadow: var(--ios-shadow-light);
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover:before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--ios-shadow-medium);
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--ios-shadow-light);
}

.btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Button Variants */
.btn-success {
    background: var(--ios-green);
}

.btn-secondary {
    background: var(--ios-secondary-background);
    color: var(--ios-blue);
    border: 1px solid var(--ios-blue);
    box-shadow: var(--ios-shadow-light);
}

.btn-danger {
    background: var(--ios-red);
}

.btn-warning {
    background: var(--ios-orange);
}

.btn-small {
    padding: 8px 16px;
    font-size: 15px;
    min-height: 36px;
    border-radius: var(--ios-radius-small);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--surface-secondary);
    color: var(--text-primary);
    transform: none;
}

/* Specific Button Types */
.create-share-btn {
    background: var(--success-color);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--ios-radius-medium);
    box-shadow: var(--ios-shadow-light);
}

.approval-action-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.approval-action-btn.change-request {
    background: var(--ios-blue);
}

.approval-action-btn.brand-approval {
    background: var(--success-color);
}

/* Timeline Mode Button States */
.btn.active {
    background: var(--success-color);
    color: white;
}

.btn.active:hover {
    background: #0f7d2f;
}

/* -----------------------------------------------------------------------------
   Form Components
   ----------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.41px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--ios-secondary-background);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--ios-radius-medium);
    padding: 16px;
    font-size: 17px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--ios-shadow-light);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    transform: scale(1.01);
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
    background: var(--surface-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-prefix {
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-right: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-height: 44px;
}

.input-group input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: none;
    flex: 1;
}

/* Checkbox Items */
.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-top: 0.125rem;
    accent-color: var(--primary-color);
}