/* Global Standardization - Consistent Design Across All Modules */

/* ===== HEADER STANDARDIZATION ===== */
.sidebar-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    height: 70px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    margin-right: auto;
}

.header-logo img {
    height: 32px;
    width: auto;
}

/* ===== LAYOUT STANDARDIZATION ===== */
.app-wrapper {
    display: flex;
    width: 100%;
    height: calc(100vh - 70px);
    margin-top: 70px;
    flex-direction: row;
}

.main-content {
    flex: 1;
    padding: 0;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    margin-left: 240px;
    overflow: hidden;
    height: 100%;
}

#mainContent {
    flex: 1;
    padding: 30px 40px;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

/* ===== CONTENT HEADER STANDARDIZATION ===== */
.content-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    border-bottom: none;
}

.content-header h1 {
    color: #1FD084;
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
}

.content-header p {
    color: #999999;
    font-size: 14px;
    font-weight: 400;
}

.content-header-left {
    flex: 1;
}

.content-header-left h1 {
    color: #1FD084;
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
}

.content-header-left p {
    color: #999999;
    font-size: 14px;
    font-weight: 400;
}

.content-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-direction: row;
}

/* ===== HEADER ICONS STANDARDIZATION ===== */
.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.header-icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: #888888;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-icon-btn:hover {
    background-color: rgba(0, 217, 255, 0.08);
}

.header-icon-btn:hover svg {
    stroke: #00D9FF;
}

/* ===== NOTIFICATION INDICATOR ===== */
.header-icon-btn {
    position: relative;
}

.notification-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 10px;
    height: 10px;
    background: #1FD084;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

.notification-indicator.active {
    display: block;
}

.notification-indicator.animating {
    animation: pulse-notification 5s infinite;
}

@keyframes pulse-notification {
    0% { box-shadow: 0 0 0 0 rgba(31, 208, 132, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(31, 208, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 208, 132, 0); }
}

/* ===== DATE WIDGET STANDARDIZATION ===== */
.date-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.date-widget-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #999999;
}

.date-widget-text {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== USER INFO STANDARDIZATION ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background-color: transparent;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.user-info:hover {
    background-color: rgba(0, 217, 255, 0.06);
    border-color: #00D9FF;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #1FD084;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-info:hover .user-avatar {
    box-shadow: 0 4px 12px rgba(31, 208, 132, 0.3);
}

.user-name {
    color: #333333;
    font-size: 13px;
    font-weight: 600;
}

.user-email {
    color: #999999;
    font-size: 11px;
    font-weight: 400;
}

/* ===== LOGOUT BUTTON STANDARDIZATION ===== */
.logout-btn {
    padding: 10px 20px;
    background-color: transparent;
    color: #888888;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logout-btn:hover {
    background-color: rgba(0, 217, 255, 0.08);
    color: #00D9FF;
    border-color: #00D9FF;
}

/* ===== PROFILE MENU STANDARDIZATION ===== */
.profile-menu {
    position: fixed;
    top: 70px;
    right: 50px;
    width: 260px;
    max-height: 65vh;
    background: white;
    border-radius: 16px;
    border: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 1001;
    overflow: hidden;
    flex-direction: column;
    display: none !important;
    backdrop-filter: blur(10px);
}

.profile-menu.active {
    display: flex !important;
    flex-direction: column;
    animation: menuSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-menu-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(135deg, #00D9FF 0%, #1FD084 100%);
    border-radius: 16px 16px 0 0;
}

.profile-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1FD084;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-menu-info {
    flex: 1;
    min-width: 0;
}

.profile-menu-name {
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.profile-menu-email {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 400;
    margin-top: 3px;
}

.profile-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e8e8e8, transparent);
    margin: 0 16px;
}

.profile-menu-section {
    padding: 16px 16px 12px;
    overflow-y: auto;
}

.profile-menu-label {
    font-size: 10px;
    font-weight: 700;
    color: #b8b8b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
    padding-left: 4px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 14px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
    letter-spacing: 0px;
}

.profile-menu-item:hover {
    background: rgba(31, 208, 132, 0.08);
    color: #1FD084;
    transform: translateX(3px);
}

.profile-menu-item.active {
    background: rgba(31, 208, 132, 0.12);
    color: #1FD084;
    font-weight: 600;
}

.profile-menu-module {
    padding: 11px 14px;
    background: rgba(31, 208, 132, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(31, 208, 132, 0.15);
}

.module-name {
    font-size: 13px;
    font-weight: 500;
    color: #1FD084;
}

.profile-menu-logout {
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid #1FD084;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1FD084;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-menu-logout:hover {
    background: #1FD084;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 208, 132, 0.3);
}

/* ===== AI CHAT BUTTON STANDARDIZATION ===== */
.ai-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1FD084 0%, #00D9FF 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(31, 208, 132, 0.3);
    z-index: 9999;
    font-size: 28px;
    font-weight: 700;
    color: white;
    transition: all 0.3s ease;
}

.ai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(31, 208, 132, 0.4);
}

.ai-chat-button:active {
    transform: scale(0.95);
}

/* ===== AI CHAT WINDOW STANDARDIZATION ===== */
.ai-chat-window {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50vw;
    height: 80vh;
    background: white;
    border-radius: 24px;
    border: 3px solid #1FD084;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-window.active {
    display: flex;
}

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

.ai-chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #1FD084 0%, #00D9FF 100%);
    color: white;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 21px 21px 0 0;
}

.ai-chat-logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #BFFF00 0%, #00D9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin-right: 12px;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat-message {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.ai-chat-message.user {
    background: #1FD084;
    color: white;
    align-self: flex-end;
    max-width: 80%;
    border-radius: 16px;
}

.ai-chat-message.ai {
    background: transparent;
    color: #333;
    align-self: flex-start;
    max-width: 85%;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0;
}

.ai-chat-message.ai::before {
    content: 'Venlyx';
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #00D9FF 0%, #BFFF00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 12px;
}

.ai-chat-message.ai .ai-bubble {
    background: white;
    color: #333;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
}

.ai-chat-message.user {
    background: #1FD084;
    color: #fff;
    align-self: flex-end;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}

.ai-chat-loading {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.ai-chat-loading span {
    width: 8px;
    height: 8px;
    background: #1FD084;
    border-radius: 50%;
    animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-chat-loading span:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ai-chat-input-area {
    padding: 12px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 8px;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    background-color: white;
    color: #333;
    font-family: inherit;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #1FD084;
    box-shadow: 0 0 0 2px rgba(31, 208, 132, 0.1);
}

.ai-chat-send {
    padding: 10px 16px;
    background: linear-gradient(135deg, #1FD084 0%, #00D9FF 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ai-chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(31, 208, 132, 0.3);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1024px) {
    .ai-chat-window {
        width: 60vw;
        height: 75vh;
    }
}

@media (max-width: 768px) {
    .sidebar-header {
        padding: 12px 20px;
    }

    .header-logo {
        font-size: 24px;
    }

    .content-header-right {
        gap: 12px;
    }

    .header-icons {
        gap: 12px;
    }

    .ai-chat-window {
        width: 90vw;
        height: 70vh;
        bottom: 80px;
        right: 10px;
    }

    #mainContent {
        padding: 20px 24px;
    }
}

@media (max-width: 480px) {
    .sidebar-header {
        padding: 10px 16px;
    }

    .header-logo {
        font-size: 20px;
    }

    .content-header-right {
        gap: 8px;
    }

    .header-icons {
        gap: 8px;
    }

    .date-widget {
        display: none;
    }

    .ai-chat-window {
        width: 95vw;
        height: 60vh;
        bottom: 70px;
        right: 5px;
    }

    #mainContent {
        padding: 16px 16px;
    }
}
