/**
 * Shared App Header Feature
 * KP-style glass morphism design for consistency across GI, KE, AA, DG
 */

.app-header {
    /* Glass morphism matching KP style */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);

    /* Layout */
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
    overflow: visible;
}

/* Left Section - App Title */
.app-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
}

.app-header-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

/* Center Section - Date/Time */
.app-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-header-datetime {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
    white-space: nowrap;
}

.app-header-date {
    color: #666;
    font-weight: 500;
    font-size: 24px;
}

.app-header-separator {
    color: #666;
    margin: 0 8px;
}

.app-header-time {
    color: #333;
    font-weight: 600;
    font-size: 24px;
}

/* Right Section - Controls */
.app-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Header Buttons - Matching KP control-btn style */
.app-header-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-size: 16px;
    position: relative;
}

.app-header-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #333;
}

.app-header-btn:active {
    transform: translateY(0);
}

.app-header-btn.danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
}

/* User Info Display */
.app-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: 34px;
    box-sizing: border-box;
}

.app-header-user i {
    color: #667eea;
    font-size: 16px;
}

.app-header-username {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
}

/* Tooltip - Matching KP style */
.app-header-btn[data-tooltip] {
    position: relative;
    z-index: 1;
}

.app-header-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
}

.app-header-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-header-datetime {
        font-size: 20px;
    }

    .app-header-date,
    .app-header-time {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-wrap: wrap;
        padding: 12px 15px;
    }

    .app-header-left {
        order: 1;
        flex: 1;
    }

    .app-header-right {
        order: 2;
        flex: 0 0 auto;
    }

    .app-header-center {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }

    .app-header-datetime {
        font-size: 18px;
    }

    .app-header-date,
    .app-header-time {
        font-size: 18px;
    }

    .app-header-title {
        font-size: 18px;
    }

    .app-header-username {
        display: none; /* Hide username on mobile to save space */
    }
}

@media (max-width: 480px) {
    .app-header-btn {
        width: 32px;
        height: 32px;
    }

    .app-header-user {
        padding: 6px 10px;
        height: 32px;
    }

    .app-header-datetime {
        font-size: 16px;
    }

    .app-header-date,
    .app-header-time {
        font-size: 16px;
    }
}
