/* Universal Reset for margin/padding */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* General Body and Font Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eeeeee; /* Your desired body background color */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding-top: 80px; /* Adjust this value if your header height changes */
}

/* Header Styling */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    box-sizing: border-box;
    background: #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

header h1 {
    margin: 0;
    font-size: 2.2em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4682A9;
}

header h1 span {
    font-family: 'Lobster Two', cursive;
    font-weight: 700;
}

.header-signin-button {
    background-color: #4682A9;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: 500;
}

.header-signin-button:hover {
    background-color: #36678c;
    transform: translateY(-1px);
}

.header-signin-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#loggedInUserInfo {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #999;
    object-fit: cover;
}

.user-name {
    margin-right: 15px;
}

/* Hide the requests info ONLY in the header */
header .requests-info { /* <-- Specific selector here */
    display: none;
}

.logout-button {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background-color: #c82333;
}

/* Intro Section (Hero Section) - This section might only be visible on the landing page */
#introSection {
    text-align: center;
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: #749BC2;
    color: white;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

#introSection .code-coach-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #91C8E4;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#introSection .code-coach-chip::before {
    content: '✨';
    font-size: 1.2em;
}

#introSection h2 {
    font-size: 3em;
    margin-top: 0;
    margin-bottom: 20px;
}

#introSection p {
    font-size: 1.5em;
    line-height: 1.6;
    margin-bottom: 40px;
}

#introSection .get-started-button {
    background-color: white;
    color: #4682A9;
    padding: 15px 35px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

#introSection .get-started-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

#introSection .get-started-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Main App Section (the "card" and content for logged-in users) */
#appSection {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #F8F9FB 0%, #E1ECF7 100%);
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0;
}

.main-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0;
}

.header-section {
    text-align: center;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #71A5DE, #83B0E1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.main-title {
    font-size: 3.5em;
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.code-text {
    background: linear-gradient(135deg, #71A5DE, #83B0E1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.character-text {
    background: linear-gradient(135deg, #83B0E1, #AECBEB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sparkle {
    font-size: 0.8em;
    color: #f39c12;
}

.subtitle {
    font-size: 1.3em;
    color: #666;
    line-height: 1.6;
    margin: 20px 0 30px 0;
}

.feature-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1em;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.badge.educational {
    background: linear-gradient(135deg, #71A5DE, #83B0E1);
}

.badge.character-based {
    background: linear-gradient(135deg, #83B0E1, #AECBEB);
}

.badge.interactive {
    background: linear-gradient(135deg, #AECBEB, #E1ECF7);
    color: #333;
}

.code-input-section {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.requests-info-container {
    text-align: center;
    margin-bottom: 20px;
}

.requests-info {
    background: linear-gradient(135deg, #71A5DE, #83B0E1);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    display: inline-block;
}

.mentor-code-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid #eee;
}

.mentor-section, .output-section {
    display: flex;
    flex-direction: column;
}

.mentor-section .code-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.mentor-header, .code-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.mentor-indicator {
    width: 4px;
    height: 20px;
    background-color: #71A5DE;
    border-radius: 2px;
}

.code-indicator {
    width: 4px;
    height: 20px;
    background-color: #83B0E1;
    border-radius: 2px;
}

.output-indicator {
    width: 4px;
    height: 20px;
    background-color: #AECBEB;
    border-radius: 2px;
}

.output-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.output-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.output-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mentor-header h3, .code-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

.mentor-subtitle {
    color: #666;
    font-size: 0.95em;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.mentor-dropdown-container {
    margin-bottom: 25px;
}

.mentor-dropdown {
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    font-family: 'Segoe UI', sans-serif;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2C114.7L159.2%2C242.5c-4.4%2C4.4-11.4%2C4.4-15.8%2C0L5.4%2C114.7c-4.4-4.4-4.4-11.4%2C0-15.8c4.4-4.4%2C11.4-4.4%2C15.8%2C0l135.2%2C135.2l135.2-135.2c4.4-4.4%2C11.4-4.4%2C15.8%2C0C291.4%2C103.3%2C291.4%2C110.3%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.mentor-dropdown:hover {
    border-color: #71A5DE;
}

.mentor-dropdown:focus {
    border-color: #71A5DE;
    box-shadow: 0 0 0 3px rgba(113, 165, 222, 0.1);
}

.pro-tip {
    background-color: #F8F9FB;
    border: 1px solid #E1ECF7;
    border-radius: 8px;
    padding: 15px;
}

.pro-tip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.lightbulb-icon {
    font-size: 1.1em;
}

.pro-tip-header span {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.pro-tip p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

.code-input-container {
    flex-grow: 1;
    margin-bottom: 20px;
}

.code-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 10px;
}

.code-placeholder .code-icon {
    background: linear-gradient(135deg, #71A5DE, #83B0E1);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.explain-code-btn {
    background: linear-gradient(135deg, #83B0E1, #71A5DE);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    width: 100%;
}

.explain-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(113, 165, 222, 0.3);
}

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

.explain-code-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Keep existing character select styles for backwards compatibility but hide the old container */
.character-select-container {
    display: none;
}

.code-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid #eee;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.code-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.code-header h3 {
    margin: 0;
    font-size: 1.8em;
    color: #333;
    font-weight: 700;
}

.tab-container {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
    width: 100%;
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #777;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    flex: 1;
    text-align: center;
}

.tab-button:hover {
    color: #444;
    border-bottom-color: #ddd;
}

.tab-button.active {
    color: #4682A9;
    border-bottom-color: #4682A9;
    font-weight: 600;
}

#codeInput {
    width: 100%;
    padding: 20px;
    border: 2px solid #eee;
    border-radius: 15px;
    font-size: 1.1em;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    min-height: 200px;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fafafa;
    line-height: 1.6;
}

#codeInput:focus {
    border-color: #71A5DE;
    box-shadow: 0 0 0 3px rgba(113, 165, 222, 0.1);
    outline: none;
    background-color: #fff;
}

#codeInput:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

#charCount {
    text-align: right;
    font-size: 0.9em;
    color: #888;
    margin: 10px 0 20px 0;
    font-weight: 500;
}

.examples-and-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.try-examples {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.try-examples span {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
}

.example-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85em;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.example-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.explain-btn {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.explain-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(142, 68, 173, 0.4);
}

.explain-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.explain-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-icon {
    font-size: 1.1em;
}

.btn-text {
    font-size: 1em;
}

#output {
    background: #fafafa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #eee;
    min-height: 300px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    line-height: 1.7;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 1.05em;
    transition: border-color 0.2s ease;
}

/* Responsive Design Updates */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5em;
        flex-direction: column;
        gap: 5px;
    }
    
    .subtitle {
        font-size: 1.1em;
    }
    
    .feature-badges {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .mentor-code-container {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 20px;
    }
    
    .mentor-section .code-section {
        margin-top: 20px;
        padding-top: 20px;
    }
    
    .explain-code-btn {
        padding: 15px 24px;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2em;
    }
    
    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .mentor-code-container {
        padding: 15px;
    }
    
    #codeInput {
        min-height: 150px;
        padding: 15px;
    }
    
    .mentor-header h3, .code-header h3 {
        font-size: 1.1em;
    }
    
    .pro-tip {
        padding: 12px;
    }
}

/* Upgrade Section */
#upgradeSection {
    background: linear-gradient(135deg, #91C8E4 0%, #749BC2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    box-sizing: border-box;
    margin: 30px auto; /* Centering with auto margins */
    max-width: 800px; /* Consistent with appSection for centering */
}

#upgradeSection h2 {
    margin-top: 0;
    font-size: 1.8em;
}

#upgradeSection p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.upgrade-button {
    background-color: #fff;
    color: #4682A9;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.upgrade-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
}

/* Manage Subscription Section */
#manageSubscriptionSection {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin: 20px auto;
    max-width: none; /* Remove max-width to match code input area */
}

.subscription-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    justify-content: center;
}

.subscription-indicator {
    width: 4px;
    height: 20px;
    background-color: #28a745;
    border-radius: 2px;
}

#manageSubscriptionSection h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.subscription-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.subscription-status-card {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.subscription-status-card.pending-cancellation {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

#subscriptionStatusText {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.subscription-status-card.pending-cancellation #subscriptionStatusText {
    text-shadow: none;
}

#cancellationPendingText {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.95em;
    color: #6c757d;
    font-style: italic;
    margin: 10px 0;
    max-width: 500px;
    line-height: 1.5;
}

.cancel-button {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #333;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 15px auto 0 auto;
    display: block;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.cancel-button:hover {
    background: linear-gradient(135deg, #e0a800, #e8661a);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
}

/* Features Section */
#featuresSection {
    width: 100%;
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center;
    background-color: #f9f6e4;
    margin-top: 0;
    margin-bottom: 0;
    box-sizing: border-box;
}

#featuresSection h2 {
    font-size: 2.5em;
    color: #4682A9;
    margin-bottom: 50px;
    margin-top: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    justify-content: center;
    align-items: start;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.feature-card {
    background-color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e6e6fa;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.icon-circle img {
    width: 125%;
    height: 125%;
    object-fit: cover;
    border-radius: 50%;
}

.feature-card h3 {
    font-size: 1.2em;
    color: #4682A9;
    margin-bottom: 5px;
}

.feature-card p {
    font-size: 0.9em;
    color: #555;
    line-height: 1.3;
    min-height: 3.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

/* Pricing Section */
#pricingSection {
    width: 100%;
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center;
    background-color: #f4f4f4;
    margin-top: 0;
    margin-bottom: 0;
    box-sizing: border-box;
}

#pricingSection h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 50px;
    margin-top: 0;
}

.pricing-cards-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.pricing-card {
    background-color: #fff;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #eee;
    position: relative;
}

.pricing-card.premium-plan {
    background-color: #4682A9;
    color: #fff;
    border-color: #4682A9;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.pricing-card h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #4682A9;
}

.pricing-card.premium-plan h3 {
    color: #fff;
}

.pricing-card .price {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.pricing-card.premium-plan .price {
    color: #fff;
}

.pricing-card .price span {
    font-size: 0.5em;
    font-weight: normal;
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    text-align: left;
    flex-grow: 1;
}

.pricing-card ul li {
    margin-bottom: 10px;
    font-size: 1.1em;
    line-height: 1.4;
    display: flex;
    align-items: center;
    color: #555;
}

.pricing-card.premium-plan ul li {
    color: #fff;
}

.pricing-card ul li i {
    color: #4CAF50;
    margin-right: 10px;
    font-size: 1.1em;
}

.pricing-card.premium-plan ul li i {
    color: #91C8E4;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn.primary-btn {
    background-color: #91C8E4;
    color: #fff;
}

.btn.primary-btn:hover {
    background-color: #749BC2;
    transform: translateY(-2px);
}

.btn.secondary-btn {
    background-color: #fff;
    color: #4682A9;
    border: 2px solid #fff;
}

.btn.secondary-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.most-popular {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #FFD700;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    z-index: 10;
}

/* Footer Styling */
.footer-section {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    box-sizing: border-box;
    background-color: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 0;
    margin-top: auto; /* Pushes footer to the bottom in a flex column */
    margin-bottom: 0;
}

.footer-section p {
    margin: 5px 0;
    color: #555;
    font-size: 0.9em;
}

.footer-links button {
    background: none;
    border: none;
    color: #4682A9;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0 10px;
    padding: 5px 10px;
    transition: color 0.2s ease;
}

.footer-links button:hover {
    color: #749BC2;
    text-decoration: underline;
}

/* Basic Responsiveness */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    #loggedInUserInfo {
        flex-direction: column;
        gap: 10px;
    }

    .user-name, .logout-button {
        margin: 0;
    }

    /* Re-evaluate header padding for smaller screens if needed */
    body {
        padding-top: 100px; /* Adjust if header height is larger on mobile */
    }

    /* Sections should maintain their margins or paddings to clear fixed header */
    #introSection {
        padding: 40px 20px;
    }
    /* Apply padding to these sections for mobile */
    #upgradeSection, #manageSubscriptionSection, #featuresSection, #pricingSection {
        margin-left: auto; /* Center with auto margins */
        margin-right: auto; /* Center with auto margins */
        padding: 20px;
        width: calc(100% - 30px); /* Adjust width for 15px margin on each side */
    }
    
    #appSection {
        padding: 0;
        margin: 0;
    }


    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tab-button {
        padding: 10px 15px;
        font-size: 0.9em;
    }


    #introSection h2 {
        font-size: 2.5em;
    }

    #introSection p {
        font-size: 1.2em;
    }

    #introSection .get-started-button {
        padding: 12px 30px;
        font-size: 1em;
    }

    #featuresSection {
        padding: 40px 15px;
    }

    #featuresSection h2 {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 25px;
    }

    .icon-circle {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }

    .icon-circle img {
        width: 45px;
        height: 45px;
    }

    .feature-card h3 {
        font-size: 1.3em;
    }

    .feature-card p {
        font-size: 0.9em;
    }

    #pricingSection h2 {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .pricing-cards-container {
        flex-direction: column;
        align-items: center;
        gap: 25px;
        padding: 0 15px;
    }

    .pricing-card {
        width: 100%;
        max-width: 350px;
        padding: 25px;
    }

    .pricing-card .price {
        font-size: 2.5em;
    }

    .pricing-card ul li {
        font-size: 1em;
    }

    .btn {
        width: 100%;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }

    #introSection h2 {
        font-size: 2em;
    }

    #introSection p {
        font-size: 1em;
    }

    #introSection .get-started-button {
        padding: 10px 25px;
        font-size: 0.9em;
    }

    .tab-container {
        flex-direction: column;
        gap: 5px;
    }

    .tab-button {
        width: 100%;
    }

    .pricing-card {
        padding: 20px;
    }
}

/* style.css (Add these styles or modify existing ones) */

/* General Layout for App Section */
#appSection {
    display: flex; /* Makes main-app-content and characterSidePanel sit side-by-side */
    justify-content: center; /* Center the main content and side panel block */
    gap: 30px; /* Provides space between the main content and the side panel */
    padding: 20px; /* Add some padding around the entire app section */
    align-items: flex-start; /* Aligns items to the top of the flex container */
    max-width: 1200px; /* Limit overall width for better readability */
    margin: 0 auto; /* Center the app section horizontally */
}

.main-app-content {
    flex: 2; /* Allows main content to take up more space */
    min-width: 450px; /* Ensure main content doesn't get too squished */
    max-width: 700px; /* Prevent main content from becoming too wide */
}

/* Character Side Panel Styling */
.character-side-panel {
    flex: 1; /* Allows side panel to take up remaining space */
    background-color: #ffffff; /* White background */
    border-radius: 10px; /* Slightly more rounded corners */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* More pronounced shadow */
    padding: 25px 20px; /* Adjusted padding inside the panel */
    position: sticky; /* Keeps the panel in view as user scrolls main content */
    top: 20px; /* Distance from the top of the viewport when sticky */
    max-height: calc(100vh - 40px); /* Max height to fit within viewport */
    overflow-y: auto; /* Adds scrollbar if content exceeds max-height */
    min-width: 280px; /* Ensure a minimum width for the side panel */
    max-width: 320px; /* Control max width for consistency */
}

.side-panel-header {
    margin-bottom: 25px; /* More space below header */
    text-align: center; /* Center the "Choose Your Character" text */
}

.side-panel-header h4 {
    font-size: 1.4em; /* Slightly larger font for header */
    color: #333;
    font-weight: 700; /* Bolder text */
    margin: 0; /* Remove default margin */
    padding-bottom: 5px; /* Add small space below text */
    border-bottom: 2px solid #eee; /* Subtle underline effect */
}

.character-list {
    margin-bottom: 25px; /* Space before quick tips */
}

.character-item {
    display: flex;
    align-items: center; /* Vertically center icon and text */
    padding: 15px 12px; /* More vertical and horizontal padding */
    margin-bottom: 15px; /* More space between items */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    border: 1px solid #f0f0f0; /* Light border for definition */
}

.character-item:last-child {
    margin-bottom: 0; /* No margin below the last item */
}

.character-item:hover {
    background-color: #f7f7f7; /* Lighter hover effect */
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* Shadow on hover */
}

.character-item.selected {
    background-color: #e6f2ff; /* A softer blue for selected state */
    border-color: #007bff; /* Primary blue border */
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
    transform: none; /* No lift when selected */
}

.character-icon {
    width: 50px; /* Larger icon size */
    height: 50px;
    border-radius: 50%;
    margin-right: 20px; /* More space between icon and text */
    object-fit: cover;
    border: 3px solid #ddd; /* Small border around icon */
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.character-item.selected .character-icon {
    border-color: #007bff; /* Blue border for selected icon */
}

.character-info {
    flex-grow: 1; /* Allows info to take up remaining horizontal space */
    display: flex; /* Use flex for name and description within this div */
    flex-direction: column; /* Stack name and description vertically */
    justify-content: center; /* Vertically center text if needed */
}

.character-name {
    font-weight: 700; /* Bolder name */
    color: #333;
    margin-bottom: 4px; /* Small space below name */
    font-size: 1.1em; /* Slightly larger font for name */
    line-height: 1.2; /* Tighter line height for name */
}

.character-description {
    font-size: 0.85em; /* Slightly larger font for description */
    color: #777;
    line-height: 1.4; /* Better readability */
}

/* Quick Tips Styling */
.quick-tips {
    padding-top: 25px;
    border-top: 1px solid #eee; /* Light separator line */
}

.quick-tips h5 {
    font-size: 1.15em; /* Slightly larger for quick tips heading */
    color: #555;
    margin-bottom: 18px; /* More space below heading */
    text-align: center; /* Center quick tips heading */
    font-weight: 600; /* Bolder quick tips heading */
}

.quick-tips p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 12px; /* More space between tips */
    display: flex;
    align-items: flex-start; /* Align icon and text to the top */
    line-height: 1.5; /* Good line height for readability */
}

.quick-tips p:last-child {
    margin-bottom: 0;
}

/* Styling for quick tip icons */
.quick-tips p::before {
    margin-right: 10px; /* Space between icon and text */
    font-size: 1.3em; /* Larger icons */
    line-height: 1; /* Align icon better with text */
    flex-shrink: 0; /* Prevent icon from shrinking */
    padding-top: 2px; /* Slight adjustment for vertical alignment */
}

/* Specific unicode icons for quick tips (adjust if you use images or font-awesome) */
.quick-tips p:nth-child(2)::before { content: '💡'; } /* Lightbulb */
.quick-tips p:nth-child(3)::before { content: '📖'; } /* Open Book */
.quick-tips p:nth-child(4)::before { content: '📝'; } /* Memo / Pencil */

/* Responsive Adjustments */
@media (max-width: 900px) {
    #appSection {
        flex-direction: column; /* Stack main content and side panel vertically */
        align-items: center; /* Center items when stacked */
        padding: 15px;
        gap: 25px; /* Slightly less gap when stacked */
    }

    .main-app-content {
        width: 100%; /* Take full width */
        min-width: unset; /* Remove min-width constraint */
        max-width: 600px; /* Constrain max-width for better look on larger tablets */
        margin-bottom: 15px; /* Space between stacked sections */
    }

    .character-side-panel {
        position: static; /* Remove sticky positioning when stacked */
        max-height: none; /* Allow panel to expand fully */
        width: 100%; /* Take full width */
        max-width: 600px; /* Constrain max-width for better look on larger tablets */
        padding: 20px;
    }
}

@media (max-width: 500px) {
    #appSection {
        padding: 0;
    }
    .main-app-content, .character-side-panel {
        padding: 15px;
    }
    .character-item {
        padding: 12px 10px; /* Reduce padding on smaller screens */
        margin-bottom: 10px;
    }
    .character-icon {
        width: 40px; /* Smaller icons on mobile */
        height: 40px;
        margin-right: 15px;
    }
    .character-name {
        font-size: 1em;
    }
    .character-description {
        font-size: 0.8em;
    }
    .side-panel-header h4 {
        font-size: 1.2em;
    }
    .quick-tips h5 {
        font-size: 1em;
    }
    .quick-tips p {
        font-size: 0.85em;
    }
    .quick-tips p::before {
        font-size: 1.1em;
    }
}


/* Styling for the new Intro Section */
.intro-section {
    background-color: #e0f2f7; /* A light, soft background */
    padding: 30px 25px; /* Keeps padding inside the section */
    margin-bottom: 20px; /* Space between this section and "Ask Your Code Coach" */
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.intro-section h3 {
    color: #007bff; /* A prominent blue for the heading */
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
}

.intro-section p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.intro-section .intro-features {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    display: flex; /* Use flexbox to space out features */
    justify-content: center; /* Center the features */
    gap: 25px; /* Space between each feature icon/text pair */
    flex-wrap: wrap; /* Allow features to wrap on smaller screens */
    margin-bottom: 0;
}




