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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: radial-gradient(#161745, #070713);
    background-attachment: fixed;
    min-height: 100vh;
    background-size: 800% 800%;
    animation: gradientPan 11s ease infinite;
}

@keyframes gradientPan {
      0% {
        background-position: 0% 50%;
      }
      50% {
        background-position: 100% 50%;
      }
      100% {
        background-position: 0% 50%;
      }
    }

/* Navigation */
.navbar {
    background: rgba(16, 18, 27, 0.826);
    backdrop-filter: blur(30px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(106, 90, 205, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(194, 166, 221, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: #e0e0e0;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(159, 172, 232, 0.5);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #d5d0db;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: #8a7fd8;
}

/* Home Page */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    background: rgba(12, 12, 14, 0.328);
    backdrop-filter: blur(60px);
    border-radius: 50px;
    padding: 1rem;
    margin-bottom: 3rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(192, 163, 220, 0.2);
}

.hero-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-image-container {
    flex: 0 0 300px;
    text-align: center;
}

.hero-image-container img {
    width: 300px;
    height: 400px;
    border-radius: 50px;
    object-fit: cover;
    border: 4px solid transparent;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 4px;
    box-shadow: 
        0 10px 40px rgba(102, 126, 234, 0.4),
        0 0 60px rgba(118, 75, 162, 0.3);
}

.hero-text {
    flex: 1;
    min-width: 300px;
    text-shadow:0 -10 30px rgba(27, 39, 93, 0.876)
}

.hero-text h1 {
    font-size: 2.5rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.bio-text {
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    color: #d3c9cf;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.quick-links {
    text-align: center;
    padding: 2rem;
}

.quick-links h2 {
    font-family: 'Lato', sans-serif;
    font-size: 2rem;
    color: #e0e0e0;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.button-container {
    display: flex;
    gap: 5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Classes Showcase Section */
.classes-showcase {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.classes-showcase-title {
    margin-bottom: 4rem;
}

.classes-showcase-title h2 {
    font-size: 2.5rem;
    color: #e0e0e0;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    margin-left: 2rem;
}

.showcase-item {
    display: flex;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.showcase-item-reverse {
    flex-direction: row-reverse;
}

.showcase-image {
    flex: 0 0 40%;
    min-width: 300px;
}

.showcase-image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 2px;
    box-shadow: 
        0 10px 40px rgba(102, 126, 234, 0.4),
        0 0 60px rgba(118, 75, 162, 0.3);
    transition: all 0.3s ease;
}

.showcase-image img:hover {
    transform: scale(1.05);
    box-shadow: 
        0 15px 50px rgba(102, 126, 234, 0.6),
        0 0 80px rgba(118, 75, 162, 0.4);
}

.showcase-text {
    flex: 1;
    min-width: 300px;
}

.showcase-text h3 {
    font-size: 1.8rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.showcase-text p {
    font-size: 1.3rem;
    color: #e8e8ff;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.chinese-text {
    font-size: 1rem;
    color: #c0b8ff;
    line-height: 1.6;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    font-style: italic;
}

/* Buttons */
.main-btn {
    display: inline-block;
    padding: 1.5rem 3rem;
    background: linear-gradient(135deg, #667eea53 0%, #764ba23f 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.main-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.main-btn:hover::before {
    left: 100%;
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(102, 126, 234, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Portfolio Page */
.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0rem;
}

.portfolio-container h1 {
    font-size: 2.5rem;
    color: #e0e0e0;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.portfolio-card {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(102, 126, 234, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(102, 126, 234, 0.4);
    border-color: rgba(138, 43, 226, 0.5);
}

.portfolio-thumbnail {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
}

.portfolio-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.portfolio-card:hover .portfolio-thumbnail::after {
    opacity: 1;
}

.portfolio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-thumbnail img {
    transform: scale(1.75);
}

.portfolio-card h3 {
    padding: 1rem;
    color: #e0e0e0;
}

.portfolio-card p {
    padding: 0 1rem 1rem 1rem;
    color: #8a7fd8;
}

/* Classes Page */
.classes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.classes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.classes-header h1 {
    font-size: 2.5rem;
    color: #e0e0e0;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.classes-grid {
    display: grid;
    gap: 2rem;
}

.class-card {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(102, 126, 234, 0.1);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    border: 1px solid rgba(138, 43, 226, 0.2);
    transition: all 0.3s ease;
}

.class-card:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.7),
        0 0 50px rgba(102, 126, 234, 0.3);
    border-color: rgba(138, 43, 226, 0.4);
}

.class-image {
    flex: 0 0 300px;
    height: 250px;
    position: relative;
    overflow: hidden;
}

.class-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.class-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.class-content {
    flex: 1;
    padding: 2rem;
    min-width: 300px;
}

.class-content h3 {
    font-size: 1.8rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.class-content p {
    color: #b0b0b0;
    line-height: 1.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
    backdrop-filter: blur(5px);
}

.modal.fullscreen {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.95);
}

/* Make the modal-content act as a neutral centering container; the actual
   border/glow is applied to the image so it matches the image dimensions
   exactly and there is no visible dark gap. */
.modal.fullscreen .modal-content {
    width: auto;
    height: auto;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    margin: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
    border: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image-wrap {
    display: inline-block;
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.fullscreen-image-wrap img {
    display: block;
    /* Try to fill viewport height so small images upscale to match others */
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    max-width: calc(100vw - 80px);
    width: auto;
    object-fit: contain;
    border: 4px solid rgba(102, 126, 234, 0.85);
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    border-radius: 6px;
    background: transparent;
    box-sizing: border-box;
}

.fullscreen-image-wrap .close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgba(24,24,36,0.85);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.06);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 1500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.close {
    color: #b0b0b0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.close:hover {
    color: #8a7fd8;
    text-shadow: 0 0 10px rgba(138, 125, 216, 0.5);
}

.portfolio-detail h2 {
    color: #e0e0e0;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.portfolio-detail p {
    color: #b0b0b0;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.media-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.2);
    transition: all 0.3s ease;
}

.media-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-color: rgba(138, 43, 226, 0.5);
}

.media-item video {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #0f0c29;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Classes Info Section */
.class-info-section {
    margin-bottom: 4rem;
}

.class-info-content {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    border: 1px solid rgba(138, 43, 226, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(102, 126, 234, 0.1);
    flex-wrap: wrap;
}

.class-info-image {
    flex: 0 0 300px;
    height: 250px;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid transparent;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 3px;
}

.class-info-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.class-info-text {
    flex: 1;
    min-width: 300px;
}

.class-info-text p {
    font-size: 1.3rem;
    color: #e8e8ff;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.class-info-text .chinese-text {
    font-size: 1rem;
    color: #c0b8ff;
    line-height: 1.6;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    font-style: italic;
}

/* Form Section */
.class-form-section {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 3rem;
    border: 1px solid rgba(138, 43, 226, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(102, 126, 234, 0.1);
}

.class-form-section h2 {
    font-size: 2rem;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.class-form-section > p {
    color: #d3c9cf;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.class-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #d3c9cf;
    font-weight: 600;
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    background: rgba(12, 12, 14, 0.5);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    padding: 0.8rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9a95aa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.8);
    background: rgba(12, 12, 14, 0.8);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 1rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

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

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    min-height: 1.5rem;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #81c784;
}

.form-message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #ef5350;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-image-container {
        flex: 0 0 auto;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .button-container {
        flex-direction: column;
        align-items: center;
    }
    
    .main-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .class-card {
        flex-direction: column;
    }
    
    .class-image {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .nav-logo {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        font-size: 0.9rem;
    }

    .showcase-item,
    .showcase-item-reverse {
        flex-direction: column;
    }

    .showcase-image {
        flex: 0 0 auto;
        min-width: auto;
    }

    .classes-showcase-title h2 {
        margin-left: 0;
        text-align: center;
    }

    .class-info-content {
        flex-direction: column;
        padding: 1.5rem;
    }

    .class-info-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
    }

    .class-info-text {
        min-width: auto;
    }

    .class-form-section {
        padding: 1.5rem;
    }

    .class-form-section h2 {
        font-size: 1.5rem;
    }

    .class-form-section > p {
        font-size: 1rem;
    }

    .submit-btn {
        width: 100%;
    }
}
