/* ========================================
   OneGo Post - Common Styles
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --color-primary: #00695c;
    --color-primary-dark: #004d40;
    --color-primary-light: #00796b;
    --color-accent: #c9a227;
    --color-accent-light: #d4ab2a;
    --color-accent-dark: #b8941f;
    
    /* Text Colors */
    --color-text: #333;
    --color-text-light: #666;
    --color-text-lighter: #999;
    --color-white: #fff;
    --color-white-90: rgba(255, 255, 255, 0.9);
    --color-white-15: rgba(255, 255, 255, 0.15);
    
    /* Background */
    --color-bg: #f5f5f5;
    --color-bg-card: #fff;
    --color-error-bg: #fee;
    --color-error: #c33;
    --color-border: #ddd;
    --color-border-light: #f0f0f0;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 16px rgba(201, 162, 39, 0.5);
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 60px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Container Width */
    --container-max: 1400px;
    --container-content: 1200px;
}

/* ========================================
   Reset & Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-bg);
    min-height: 100vh;
    color: var(--color-text);
    line-height: 1.6;
}

/* ========================================
   Navigation Bar
   ======================================== */
.navbar {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--color-accent);
}

.navbar-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 15px var(--spacing-lg);
}

.navbar-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.navbar-title-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-title-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar h1 {
    font-size: 26px;
    cursor: pointer;
    color: var(--color-white);
    font-weight: 700;
    flex-shrink: 0;
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 0%, #ffd54f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 213, 79, 0.3);
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    position: relative;
    padding: 2px 0;
}

.navbar h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #ffd54f 50%, transparent 100%);
    opacity: 0.5;
}

.user-info-small {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 32px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--color-white);
    font-weight: 600;
    border: 1px solid rgba(255, 213, 79, 0.4);
    transition: var(--transition);
    user-select: none;
    display: inline-block;
    text-align: center;
}

.user-info-small:hover {
    background: rgba(255, 213, 79, 0.25);
    border-color: rgba(255, 213, 79, 0.6);
    transform: scale(1.02);
}

/* 编辑个人信息按钮（外部独立版本 - 与客户ID框并排） */
.edit-userinfo-button {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 32px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--color-white);
    font-weight: 600;
    border: 1px solid rgba(255, 213, 79, 0.4);
    transition: var(--transition);
    user-select: none;
    display: inline-block;
    text-align: center;
    margin-left: 10px;
    cursor: pointer;
    text-decoration: none;
}

/* 站内信按钮右边padding增加（因为有红点提示） */
.edit-userinfo-button.messages-button {
    padding-right: 16px;
}

.edit-userinfo-button:hover {
    background: rgba(255, 213, 79, 0.25);
    border-color: rgba(255, 213, 79, 0.6);
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.navbar-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* 用户信息和编辑图标的容器 */
.user-info-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: var(--color-white-90);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    padding: 6px 12px;
    cursor: pointer;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ffd54f;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    background: var(--color-white-15);
    color: #ffd54f;
    transform: translateY(-1px);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: #ffd54f;
    background: rgba(255, 213, 79, 0.2);
    font-weight: 600;
}

.nav-link.active::after {
    width: 80%;
}

.navbar-menu {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: auto;
}

.user-info {
    background: var(--color-white-15);
    padding: var(--spacing-xs) 16px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    color: var(--color-white);
    font-weight: 500;
    border: 1px solid rgba(255, 213, 79, 0.3);
}

/* ========================================
   Buttons
   ======================================== */
.btn-logout,
.btn-back {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    border: none;
    color: var(--color-white);
    padding: 9px var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover,
.btn-back:hover {
    background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-customer-service,
.btn-addresses,
.btn-logout-icon {
    background: transparent;
    border: none;
    color: var(--color-white);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    line-height: 1.2;
}

/* 在 receivers 和 post-offices 页面，Manzillar 按钮显示金黄色 */
body.page-receivers .btn-addresses,
body.page-post-offices .btn-addresses {
    color: #ffd54f;
}

.btn-customer-service .icon,
.btn-addresses .icon,
.btn-logout-icon .icon {
    font-size: 20px;
}

.btn-customer-service .text,
.btn-addresses .text,
.btn-logout-icon .text {
    font-size: 11px;
}

.btn-customer-service:hover,
.btn-addresses:hover,
.btn-logout-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffd54f;
}

/* 在 receivers 和 post-offices 页面，Manzillar 按钮悬停效果 */
body.page-receivers .btn-addresses:hover,
body.page-post-offices .btn-addresses:hover {
    background: rgba(255, 213, 79, 0.15);
    color: #ffeb3b;
}

/* ========================================
   Container
   ======================================== */
.container {
    max-width: var(--container-content);
    margin: 0 auto;
    padding: 0 var(--spacing-md) 80px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-xl);
    border-top: 3px solid var(--color-accent);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: var(--container-content);
    margin: 0 auto;
}

.footer p {
    font-size: 15px;
    opacity: 0.95;
    letter-spacing: 0.3px;
}

.footer a {
    color: #ffd54f;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.footer a:hover {
    color: var(--color-white);
    border-bottom-color: var(--color-accent);
}

/* ========================================
   Loading & Error States
   ======================================== */
.loading-spinner {
    text-align: center;
    padding: var(--spacing-xl);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: linear-gradient(135deg, var(--color-error-bg) 0%, #fdd 100%);
    color: var(--color-error);
    padding: var(--spacing-md);
    border-radius: var(--spacing-sm);
    text-align: center;
    font-size: 16px;
    margin: var(--spacing-md) 0;
    border-left: 4px solid var(--color-error);
    box-shadow: 0 4px 12px rgba(204, 51, 51, 0.15);
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message::before {
    content: '⚠️ ';
    font-size: 20px;
    margin-right: var(--spacing-xs);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .navbar-title-group {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .navbar-title-row {
        flex-shrink: 1;
    }

    .navbar-bottom-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .navbar h1 {
        font-size: 18px;
        letter-spacing: 0.5px;
    }

    .navbar h1::after {
        height: 1.5px;
    }

    .user-info-small {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    /* 编辑个人信息按钮手机版 */
    .edit-userinfo-button {
        font-size: 10px;
        padding: 4px 8px;
        margin-left: 6px;
    }

    .btn-customer-service,
    .btn-addresses,
    .btn-logout-icon {
        font-size: 10px;
        padding: 4px 6px;
    }
    
    /* 移动端 - receivers 和 post-offices 页面的 Manzillar 按钮 */
    body.page-receivers .btn-addresses,
    body.page-post-offices .btn-addresses {
        color: #ffd54f;
    }

    .btn-customer-service .icon,
    .btn-addresses .icon,
    .btn-logout-icon .icon {
        font-size: 18px;
    }

    .btn-customer-service .text,
    .btn-addresses .text,
    .btn-logout-icon .text {
        font-size: 10px;
    }
    
    /* 移动端 - receivers 和 post-offices 页面的 Manzillar 按钮文字 */
    body.page-receivers .btn-addresses .text,
    body.page-post-offices .btn-addresses .text {
        color: #ffd54f;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 14px;
    }  

    .navbar-menu {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }

    .user-info {
        padding: 6px var(--spacing-sm);
        font-size: 13px;
    }

    .btn-logout,
    .btn-back {
        font-size: 13px;
        padding: 7px 16px;
    }

    .container {
        padding: 0 15px;
    }

    .footer {
        padding: 25px var(--spacing-md);
    }

    .footer p {
        font-size: 14px;
    }
}

/* ========================================
   Customer Service Modal
   ======================================== */
.cs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.cs-modal.active {
    display: flex;
}

.cs-modal-content {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cs-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
}

.cs-modal-close:hover {
    color: var(--color-error);
}

.cs-modal-title {
    font-size: 22px;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.cs-modal-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.cs-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    justify-content: center;
}

.cs-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
}

.cs-option:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 105, 92, 0.3);
}

.cs-option:hover .cs-option-icon {
    transform: scale(1.1);
}

.cs-option:hover .cs-option-name {
    color: var(--color-white);
}

.cs-option-icon {
    font-size: 18px;
    transition: var(--transition);
}

.cs-option-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    transition: var(--transition);
}

@media (max-width: 480px) {
    .cs-modal-content {
        padding: var(--spacing-lg);
    }

    .cs-options {
        flex-direction: column;
    }

    .cs-option {
        flex-direction: row;
        justify-content: center;
    }
    
    /* 编辑个人信息模态框手机版优化 */
    #editUserInfoModal .cs-modal-content {
        padding: 20px 15px;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #editUserInfoModal .cs-modal-title {
        font-size: 16px !important;
        margin-bottom: 15px;
    }
    
    #editUserInfoModal .cs-modal-close {
        font-size: 24px;
        top: 10px;
        right: 15px;
    }
    
    #editUserInfoForm {
        padding: 10px !important;
    }
    
    #editUserInfoForm > div {
        margin-bottom: 10px !important;
    }
    
    #editUserInfoForm label {
        font-size: 12px !important;
        margin-bottom: 3px !important;
    }
    
    #editUserInfoForm input,
    #editUserInfoForm textarea {
        padding: 8px !important;
        font-size: 13px !important;
    }
    
    #editUserInfoForm button {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    #editUserInfoForm .warning-box {
        padding: 8px !important;
        font-size: 11px !important;
        margin-bottom: 10px !important;
    }
}

/* ========================================
   Message Type Badge
   ======================================== */
.type-badge {
    display: inline-block;
    font-size: 18px;
    margin: 0 4px;
    cursor: help;
}

/* ========================================
   New Message Badge (Red Dot)
   ======================================== */
.new-message-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background: #f44336;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* ========================================
   Message Detail Modal
   ======================================== */
.message-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.message-detail-content {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.message-detail-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
}

.message-detail-close:hover {
    color: var(--color-error);
}

.message-detail-title {
    font-size: 18px;
    color: var(--color-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}

.message-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
    min-height: 200px;
    max-height: 50vh;
}

/* 聊天区域滚动条样式 */
.message-detail-body::-webkit-scrollbar {
    width: 8px;
}

.message-detail-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.message-detail-body::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.message-detail-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.detail-message-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
}

/* 管理员消息样式 */
.detail-message-item.admin {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
    margin-right: 20%;
}

/* 用户消息样式 */
.detail-message-item.user {
    background: #f1f8e9;
    border-left: 3px solid #558b2f;
    margin-left: 20%;
}

.detail-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.detail-message-sender {
    font-weight: 600;
    font-size: 13px;
}

/* 管理员名字颜色 */
.detail-message-item.admin .detail-message-sender {
    color: #1976d2;
}

/* 用户名字颜色 */
.detail-message-item.user .detail-message-sender {
    color: #558b2f;
}

.detail-message-time {
    font-size: 11px;
    color: var(--color-text-lighter);
}

.detail-message-content {
    color: var(--color-text);
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: 14px;
}

/* 消息输入框 */
.message-input-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--color-border);
}

.message-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.message-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 105, 92, 0.1);
}

.btn-send-message {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-send-message:hover {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 105, 92, 0.3);
}

@media (max-width: 768px) {
    .message-detail-content {
        width: 95%;
        max-height: 85vh;
        padding: 15px;
    }
    
    .detail-message-item.admin {
        margin-right: 10%;
    }
    
    .detail-message-item.user {
        margin-left: 10%;
    }
}









