/* Global Styles */
:root {
    --primary-color: #409AEA;
    --primary-dark: #2980b9;
    --primary-light: #64b5f6;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-text: #ffffff;
    --background-color: #f8f9fa;
    --card-background: #fff;
    --border-radius: 20px;
    --box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    --gradient-blue: linear-gradient(135deg, #409AEA, #5643CC);
    --gradient-purple: linear-gradient(135deg, #7F7FD5, #91EAE4);
    --gradient-orange: linear-gradient(135deg, #FFB347, #FFCC33);
    --gradient-green: linear-gradient(135deg, #34e89e, #0f3443);
    --gradient-red: linear-gradient(135deg, #FF5F6D, #FFC371);
    --gradient-dark: linear-gradient(135deg, #2c3e50, #1a2530);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-y;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    user-select: none;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border-top: 5px solid var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content Container */
#content {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Swiper Container */
.swiper-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.swiper-slide {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: pan-y;
}

/* Swipe indicator and instruction */
.swipe-instruction {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.swipe-instruction p {
    color: white;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.swipe-indicator {
    color: white;
    animation: swipe-hint 1.5s infinite;
}

@keyframes swipe-hint {
    0% { transform: translateX(-5px); opacity: 0.5; }
    50% { transform: translateX(5px); opacity: 1; }
    100% { transform: translateX(-5px); opacity: 0.5; }
}

.swipe-indicator svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

/* Animation for slide content */
.slide-in-right {
    animation: slide-in-right 0.6s both;
}

@keyframes slide-in-right {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pagination improvements */
.swiper-pagination {
    bottom: 40px !important;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    width: 20px;
    border-radius: 5px;
    background: white;
    opacity: 1;
}

/* Navigation button styling */
.swiper-button-next, 
.swiper-button-prev {
    color: white;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.swiper-button-next:active, 
.swiper-button-prev:active {
    opacity: 1;
    transform: scale(0.95);
}

/* Card Styles */
.card {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--card-background);
    overflow: hidden;
}

.circuit-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPgogIDxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiPgogICAgPHBhdGggZD0iTTAgNSBMNSAwIE0xNSAwIEwyMCA1IE00MCAxNSBMMzUgMjAgTTQwIDM1IEwzNSA0MCBNMTUgNDAgTDIwIDM1IE0wIDI1IEw1IDIwIE0wIDE1IEw1IDIwIE0zNSAwIEw0MCA1IiBzdHJva2U9InJnYmEoMjU1LCAyNTUsIDI1NSwgMC4yKSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIi8+CiAgPC9wYXR0ZXJuPgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjcGF0dGVybikiLz4KPC9zdmc+');
    opacity: 0.2;
    z-index: 0;
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2rem;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Restart button */
.restart-button {
    margin-top: 2rem;
    margin-bottom: 60px;
}

.restart-button button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.restart-button button:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* Media Queries - Additional mobile optimizations */
@media (max-width: 480px) {
    .card-content {
        padding: 1.5rem;
        padding-bottom: 50px;
    }
    
    .card-1 h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .welcome-message {
        font-size: 1.1rem;
        padding: 1.2rem;
    }
    
    .welcome-message #welcome-name {
        font-size: 1.3rem;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .record-number {
        font-size: 3rem;
    }
    
    .swipe-indicator svg {
        width: 24px;
        height: 24px;
    }
    
    .swipe-instruction p {
        font-size: 0.9rem;
    }
    
    .swiper-button-next, 
    .swiper-button-prev {
        display: none;
    }
    
    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
    
    .swiper-pagination-bullet-active {
        width: 16px;
    }
    
    .swiper-pagination {
        bottom: 30px !important;
    }
    
    .note {
        bottom: 60px !important;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .swiper-container {
        height: -webkit-fill-available;
    }
}

/* Card 1: Welcome */
.card-1 {
    background: linear-gradient(135deg, #8A2387, #E94057, #F27121);
}

.card-1 h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.welcome-message {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.welcome-message #welcome-name {
    font-weight: bold;
    margin: 0 0.3rem;
    background: linear-gradient(to right, #fff, #f9f9f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.8rem;
}

.swipe-indicator {
    margin-top: 2rem;
    color: white;
    animation: swipe-hint 1.5s infinite;
}

@keyframes swipe-hint {
    0% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(10px); opacity: 1; }
    100% { transform: translateX(0); opacity: 0.5; }
}

.swipe-indicator svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.note {
    position: absolute;
    bottom: 80px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Card 2: First duty */
.card-2 {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.card-2 h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.card-2 p {
    color: white;
}

.duty-info {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.duty-info p {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.duty-info span {
    font-weight: bold;
    margin: 0 0.3rem;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.calendar-container {
    width: 100%;
    max-width: 320px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.month-item {
    padding: 8px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.8rem;
    color: white;
    transition: all 0.3s ease;
}

.month-active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Card 3: Duty count */
.card-3 {
    background: linear-gradient(135deg, #7F7FD5, #86A8E7, #91EAE4);
}

.card-3 h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stats-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 90%;
    max-width: 450px;
}

.stat-item {
    text-align: center;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background: linear-gradient(to right, #fff, #f9f9f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
}

.highlight-message {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: white;
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    font-weight: 500;
}

/* Card 4: Max monthly hours */
.card-4 {
    background: linear-gradient(135deg, #FF5F6D, #FFC371);
}

.card-4 h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.record-display {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    width: 90%;
    max-width: 350px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.month-badge {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.record-number {
    font-size: 4.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: linear-gradient(to right, #fff, #f9f9f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.record-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 500;
}

/* Card 5: Time slot preferences */
.card-5 {
    background: linear-gradient(135deg, #43cea2, #185a9d);
}

.card-5 h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.time-slots {
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.favorite-time {
    text-align: center;
    margin-top: 2rem;
    color: white;
    font-size: 1.3rem;
}

.favorite-time span {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-left: 0.5rem;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Card 6: Attendance */
.card-6 {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
}

.card-6 h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.attendance-stats {
    width: 90%;
    max-width: 400px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row .stat-label {
    text-align: left;
    font-size: 1.1rem;
}

.stat-row .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
}

/* Card 7: Work orders and overtime */
.card-7 {
    background: linear-gradient(135deg, #a18cd1, #fbc2eb);
}

.card-7 h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.overtime-stats {
    width: 90%;
    max-width: 400px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Card 8: Graduation */
.card-8 {
    background: linear-gradient(135deg, #000428, #004e92);
}

#graduation-animation {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.names-container {
    width: 100%;
    height: 70%;
    position: relative;
    perspective: 800px;
}

.flying-name {
    position: absolute;
    color: white;
    font-size: 1.3rem;
    opacity: 0;
    transform: translateZ(0) scale(0.5);
    animation: fly-out 3s forwards;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

@keyframes fly-out {
    0% {
        opacity: 0;
        transform: translateZ(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateZ(200px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateZ(1000px) scale(2);
    }
}

.congrats-message {
    color: white;
    font-size: 3.5rem;
    font-weight: bold;
    margin-top: 2rem;
    opacity: 0;
    animation: fade-in 1s 2s forwards;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    background: linear-gradient(to right, #fff, #f9f9f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

/* Show all assistants button */
.show-all-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.show-all-button:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.show-all-button svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 20px;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-button:hover {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.assistants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.assistant-item {
    text-align: center;
    padding: 15px;
    border-radius: 15px;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.assistant-item:hover {
    background: linear-gradient(135deg, #409AEA, #5643CC);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

#search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
    margin-top: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(64, 154, 234, 0.15);
}

/* Media Queries */
@media (max-width: 768px) {
    .card-content {
        padding: 1.5rem;
    }

    .card-1 h1 {
        font-size: 2rem;
    }

    .welcome-message {
        font-size: 1.2rem;
        padding: 1.5rem;
    }

    .welcome-message #welcome-name {
        font-size: 1.5rem;
    }

    .swipe-indicator svg {
        width: 30px;
        height: 30px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .record-number {
        font-size: 3.5rem;
    }

    .congrats-message {
        font-size: 2.8rem;
    }
    
    .month-badge {
        font-size: 1.1rem;
        padding: 0.5rem 1rem;
    }
    
    .stat-row .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .card-content {
        padding: 1rem;
    }

    .card-1 h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .welcome-message {
        font-size: 1.1rem;
        padding: 1.2rem;
    }
    
    .welcome-message #welcome-name {
        font-size: 1.3rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .record-number {
        font-size: 3rem;
    }

    .congrats-message {
        font-size: 2.2rem;
    }

    .calendar-container {
        padding: 0.5rem;
        gap: 5px;
    }

    .month-item {
        padding: 5px;
        font-size: 0.7rem;
    }
    
    .month-badge {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    .highlight-message {
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
    }
    
    .stat-row .stat-value {
        font-size: 1.3rem;
    }
}

/* Chart styles */
.chart-container {
    width: 100%;
    height: 220px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
} 