/* ============================================
   Leave Status Page - Faithful Replica Styles
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    -webkit-overflow-scrolling: touch;
    height: 100%;
    font-size: 3.73333vw;
    color: #657180;
    background: #f5f7f9;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
}

a {
    text-decoration: none;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    background: #f5f7f9;
    padding-bottom: 5.33333vw;
    position: relative;
}

/* ========== Status Flag Header ========== */
.cat-status-flag {
    height: 25.06667vw;
    font-size: 0;
    position: relative;
}

.cat-status-flag .flag-dom {
    display: flex;
    width: 100%;
    height: 100%;
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cat-status-flag .flag-dom .flag-text {
    flex: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    position: relative;
    width: 100%;
}

.cat-status-flag .flag-dom .personal-info {
    position: absolute;
    top: 2.66667vw;
    right: 5.33333vw;
    font-size: 3.73333vw;
    font-style: normal;
    color: #fff;
    cursor: pointer;
}

.cat-status-flag .flag-dom .status-text-bold {
    margin-top: 1.33333vw;
    font-size: 8.53333vw;
    font-style: normal;
    font-weight: 400;
    line-height: 8.53333vw;
    letter-spacing: 1.06667vw;
    color: #fff;
}

.cat-status-flag .flag-dom .status-svg-text {
    display: flex;
    margin-top: -1.33333vw;
    font-size: 4.26667vw;
    font-style: normal;
    font-weight: 400;
    letter-spacing: .53333vw;
    color: #fff;
    align-items: center;
}

.cat-status-flag .flag-dom .status-svg-text .svg-icon {
    width: 4.8vw;
    height: 4.8vw;
    margin-right: 1.33333vw;
}

/* Dynamic strip animation - white parallelograms flowing right */
@keyframes move {
    0% {
        background-position: 0 0;
    }
    to {
        background-position: 16vw 0;
    }
}

@-webkit-keyframes move {
    0% {
        background-position: 0 0;
    }
    to {
        background-position: 16vw 0;
    }
}

.cat-status-flag .flag-dom .dynamic-strip {
    display: flex;
    width: 100%;
    height: 4.26667vw;
    margin: 0 auto;
    background-image: linear-gradient(
        135deg,
        #fff 0%,
        #fff 25%,
        transparent 25%,
        transparent 50%,
        #fff 50%,
        #fff 75%,
        transparent 75%,
        transparent 100%
    );
    background-size: 16vw 16vw;
    -webkit-animation: move 1s linear infinite;
    animation: move 1s linear infinite;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cat-status-flag .flag-dom .dynamic-strip .now-time {
    padding: 0 1.33333vw;
    font-size: 3.2vw;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 1.86667vw;
    white-space: nowrap;
}

/* Status flag color variants */
.flag-success {
    background: linear-gradient(180deg, #00a857, #00dd73);
}

.flag-warning {
    background: linear-gradient(180deg, #f66c08 1%, #f8aa24);
}

.flag-error {
    background: linear-gradient(180deg, #f40, #f79677 97%);
}

.flag-grey {
    background: linear-gradient(0deg, #9ea7b4, #657180);
}

/* ========== User Info Card ========== */
.user-card {
    display: flex;
    align-items: center;
    padding: 4vw 5.33333vw;
    background: #fff;
}

.user-avatar {
    width: 12.8vw;
    height: 12.8vw;
    border-radius: 50%;
    background-color: #07c160;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.26667vw;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 3.2vw;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 4.26667vw;
    color: #464c5b;
    font-weight: 700;
}

.user-id {
    font-size: 3.2vw;
    color: #9ea7b4;
    margin-top: 0.53333vw;
}

/* ========== Leave Info Section ========== */
.leave-info-section {
    padding: 2.66667vw 5.33333vw;
    background: #fff;
}

.info-row {
    display: flex;
    align-items: flex-start;
    padding: 1.33333vw 0;
    line-height: 6.4vw;
    font-size: 3.73333vw;
    flex-wrap: wrap;
}

.info-label {
    color: #464c5b;
    flex-shrink: 0;
}

.info-value {
    color: #657180;
}

.cancel-rule {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.rule-text {
    color: #f40;
    font-size: 3.73333vw;
}

.rule-link {
    color: #39f;
    font-size: 3.73333vw;
    margin-left: 1.33333vw;
    cursor: pointer;
    white-space: nowrap;
}

/* ========== Section Divider ========== */
.section-divider {
    height: 2.66667vw;
    background: #f5f7f9;
}

/* ========== Leave Application Section ========== */
.leave-application-section {
    background: #fff;
    padding: 4vw 5.33333vw;
    position: relative;
}

.section-title {
    font-size: 4.26667vw;
    color: #464c5b;
    font-weight: 700;
    padding-bottom: 2.66667vw;
    border-bottom: 1px solid #e3e8ee;
    margin-bottom: 2.66667vw;
}

.application-detail {
    position: relative;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 1.6vw 0;
    line-height: 6.4vw;
    font-size: 3.73333vw;
}

.detail-label {
    color: #9ea7b4;
    flex-shrink: 0;
    min-width: 18.66667vw;
}

.detail-value {
    color: #464c5b;
    flex: 1;
    word-break: break-all;
}

.detail-value.bold {
    font-weight: 700;
}

.location-link {
    color: #39f;
    font-size: 3.73333vw;
}

/* Duration Badge */
.duration-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(51, 153, 255, 0.1);
    color: #39f;
    font-size: 3.73333vw;
    padding: 1.6vw 4vw;
    border-radius: 1.6vw;
    font-weight: 500;
    border: 1px solid #91c3fd;
}

/* Approved Stamp */
.approved-stamp {
    position: absolute;
    top: 21.33333vw;
    right: 2.66667vw;
    width: 18.66667vw;
    pointer-events: none;
}

.stamp-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Attachment */
.attachment-row {
    flex-wrap: wrap;
}

.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 2.13333vw;
    margin-top: 1.33333vw;
}

.attachment-img {
    width: 21.33333vw;
    height: 21.33333vw;
    object-fit: cover;
    border-radius: 1.06667vw;
    cursor: pointer;
    border: 1px solid #e3e8ee;
}

/* ========== Disclaimer ========== */
.disclaimer {
    padding: 4vw 5.33333vw;
    font-size: 3.73333vw;
    color: #f90;
    line-height: 5.86667vw;
    font-weight: 700;
}

/* ========== Smart Customer Service Button ========== */
.boyaService {
    position: fixed;
    z-index: 9998;
    right: 0;
    bottom: 32vw;
    width: 1em;
    padding: 2.66667vw 1.6vw;
    font-size: 3.2vw;
    background: #3399fe;
    color: #fff;
    box-sizing: initial;
    border-radius: 1.6vw 0 0 1.6vw;
    line-height: 1.3;
    box-shadow: -0.53333vw 0 1.06667vw rgba(0, 0, 0, 0.1);
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.boyaService .service-icon {
    width: 4.26667vw;
    height: 4.26667vw;
    margin-bottom: 1.33333vw;
    color: #fff;
}

.boyaService span {
    color: #fff;
    display: block;
}

/* ========== Cancel Rule Modal ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 85.33333vw;
    background: #fff;
    border-radius: 4.26667vw;
    overflow: hidden;
    animation: modalBounceIn 0.3s ease-out;
}

@keyframes modalBounceIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    padding: 5.33333vw 0 0;
    font-size: 4.26667vw;
    font-weight: 700;
    color: #464c5b;
    text-align: center;
}

.modal-body {
    padding: 5.33333vw 6.4vw;
    font-size: 3.73333vw;
    color: #657180;
    line-height: 7.46667vw;
}

.modal-body p {
    margin: 0;
    padding: 0;
}

.modal-footer {
    border-top: 1px solid #e3e8ee;
    text-align: center;
    padding: 3.2vw 0;
}

.modal-btn {
    color: #39f;
    font-size: 3.73333vw;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    line-height: 6.4vw;
}

/* ========== Personal Info Modal ========== */
.personal-info-modal {
    width: 76%;
    max-height: 70vh;
    background: #fff;
    border-radius: 4.26667vw;
    overflow: hidden;
    animation: modalBounceIn 0.3s ease-out;
    position: relative;
}

.personal-info-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vw 5.33333vw 0;
    position: relative;
}

.personal-info-title {
    font-size: 4.26667vw;
    font-weight: 700;
    color: #464c5b;
    text-align: center;
}

.personal-info-close {
    position: absolute;
    top: 2.66667vw;
    right: 4vw;
    width: 6.4vw;
    height: 6.4vw;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.26667vw;
    color: #9ea7b4;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

.personal-info-close:active {
    background: #e0e0e0;
}

.personal-info-body {
    padding: 4vw 5.33333vw 5.33333vw;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.personal-info-row {
    display: flex;
    align-items: flex-start;
    padding: 1.6vw 0;
    line-height: 6.4vw;
    font-size: 3.73333vw;
}

.pi-label {
    color: #464c5b;
    flex-shrink: 0;
    white-space: nowrap;
}

.pi-value {
    color: #657180;
    word-break: break-all;
}

.pi-bold {
    font-weight: 700;
}

/* ========== Image Preview ========== */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-preview-full {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 2.13333vw;
}

/* ========== Responsive ========== */
@media (min-width: 750px) {
    html, body {
        font-size: 14px;
    }

    .app-container {
        max-width: 750px;
        margin: 0 auto;
        position: relative;
    }

    .cat-status-flag {
        height: 188px;
    }

    .cat-status-flag .flag-dom .status-text-bold {
        font-size: 64px;
        line-height: 64px;
        letter-spacing: 8px;
    }

    .cat-status-flag .flag-dom .status-svg-text {
        font-size: 32px;
    }

    .cat-status-flag .flag-dom .status-svg-text .svg-icon {
        width: 36px;
        height: 36px;
    }

    .cat-status-flag .flag-dom .dynamic-strip {
        height: 32px;
    }

    .boyaService {
        right: calc(50% - 375px);
    }
}
