:root {
    --primary-start: #19A7E0;
    --primary-end: #1EAAD9;
    --primary-dark: #1492C5;
    --accent: #FF6B35;
    --text-dark: #1a1a2e;
    --text-medium: #3d4451;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(25, 167, 224, 0.08);
    --shadow-md: 0 4px 16px rgba(25, 167, 224, 0.12);
    --shadow-lg: 0 8px 32px rgba(25, 167, 224, 0.16);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px;
    animation: fadeInUp 0.8s var(--transition);
}

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

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.profile-image-wrapper {
    position: relative;
    animation: scaleIn 0.6s var(--transition) 0.2s backwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.profile-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.profile-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.9);
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    display: block;
}

.hero-text {
    animation: fadeInUp 0.8s var(--transition) 0.4s backwards;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
}

.tagline {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* Student Zone Section */
.student-zone {
    padding: 80px 0;
    background: var(--bg-light);
    position: relative;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-bottom: 50px;
    font-weight: 400;
}

.zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.zone-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(25, 167, 224, 0.08);
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.6s var(--transition) backwards;
}

.zone-card:nth-child(1) { animation-delay: 0.1s; }
.zone-card:nth-child(2) { animation-delay: 0.2s; }
.zone-card:nth-child(3) { animation-delay: 0.3s; }
.zone-card:nth-child(4) { animation-delay: 0.4s; }
.zone-card:nth-child(5) { animation-delay: 0.5s; }

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

.zone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--transition);
}

.zone-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(25, 167, 224, 0.2);
}

.zone-card:hover::before {
    transform: scaleX(1);
}

.zone-card:active {
    transform: translateY(-2px);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s var(--transition);
}

.zone-card:hover .card-icon {
    transform: scale(1.05);
}

.card-icon svg {
    width: 28px;
    height: 28px;
    color: white;
    stroke-width: 2.2;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background: var(--bg-white);
}

.about-content {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.about-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 700px;
    width: 100%;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(25, 167, 224, 0.1);
    animation: fadeInUp 0.8s var(--transition);
}

.about-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(25, 167, 224, 0.1);
}

.educator-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.credentials {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.credential-badge {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.detail-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(25, 167, 224, 0.1), rgba(30, 170, 217, 0.15));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-start);
}

.detail-text h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.detail-text p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Footer */
.footer {
    background: var(--text-dark);
    padding: 40px 0;
    text-align: center;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 6px 0;
}

/* Embedded View */
.embedded-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.embedded-view.hidden {
    display: none;
}

.embedded-header {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--transition);
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.back-button:active {
    transform: scale(0.98);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

.content-frame {
    flex: 1;
    border: none;
    width: 100%;
    background: white;
}

.offline-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 40px;
    max-width: 400px;
    width: 90%;
}

.offline-message.hidden {
    display: none;
}

.offline-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(25, 167, 224, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offline-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary-start);
}

.offline-message h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.offline-message p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(25, 167, 224, 0.2);
    border-top-color: var(--primary-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-white);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s var(--transition);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.install-prompt.hidden {
    display: none;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-content p {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.install-button {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s var(--transition);
    font-size: 0.9rem;
}

.install-button:hover {
    transform: scale(1.05);
}

.install-button:active {
    transform: scale(0.98);
}

.dismiss-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s var(--transition);
}

.dismiss-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        min-height: 55vh;
    }
    
    .hero-content {
        padding: 40px 20px;
    }
    
    .profile-image {
        width: 120px;
        height: 120px;
    }
    
    .student-zone,
    .about-section {
        padding: 60px 0;
    }
    
    .zone-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .about-card {
        padding: 28px 20px;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .profile-image {
        width: 100px;
        height: 100px;
    }
    
    .zone-card {
        padding: 24px 20px;
    }
    
    .card-icon {
        width: 48px;
        height: 48px;
    }
    
    .card-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* Prevent horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Safe area support for iOS */
@supports (padding: env(safe-area-inset-top)) {
    .embedded-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
}
