* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", serif;
}

body {
    background: #000000;
    min-height: 100vh;
    color: white;
}

header {
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    background: #fff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 28px;  /* Reduced from 32px */
    height: 28px; /* Reduced from 32px */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents icon from shrinking */
}

.logo-icon img,
.logo-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures image maintains aspect ratio */
    max-width: 100%;
    max-height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo {
        font-size: 1.3rem;
        gap: 8px;
    }

    .logo-icon {
        width: 22px;  /* Reduced from 24px */
        height: 22px; /* Reduced from 24px */
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-credits {
    color: #e2e8f0;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-credits {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-credits::before {
    content: '⚡';
    font-size: 1rem;
}

.profile-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none; /* Will be shown when .show class is added */
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: rgba(25, 25, 25, 0.98);
    backdrop-filter: blur(10px);
    min-width: 200px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Bridge to prevent dropdown from closing */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

/* Show dropdown */
.dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Divider in dropdown */
.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, rgba(191, 95, 255, 0.1), rgba(95, 159, 255, 0.1));
    border: 2px solid rgba(191, 95, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #fff;
    font-size: 0.9rem;
}

.profile-icon:hover {
    background: linear-gradient(45deg, rgba(191, 95, 255, 0.2), rgba(95, 159, 255, 0.2));
    border-color: rgba(191, 95, 255, 0.3);
    transform: translateY(-1px);
}

/* Updated dropdown styles */
.dropdown-content {
    background: rgba(25, 25, 25, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
}

.dropdown-content a {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    text-decoration: none;
}

.dropdown-content a:hover {
    background: rgba(191, 95, 255, 0.1);
}

.dropdown-content .fa-solid {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .user-greeting {
        display: none;
    }

    .header-right {
        gap: 1rem;
    }

    .new-gen-btn {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .user-credits {
        display: none;
    }
}

.new-gen-btn {
    background: #ffffff;
    color: black;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(191, 95, 255, 0.2);
}

.new-gen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(191, 95, 255, 0.3);
}

.new-gen-btn::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 500;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.new-gen-btn:hover::after {
    transform: rotate(90deg);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Notification dot for icon-btn */
.icon-btn::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #bf5fff;
    border-radius: 50%;
    border: 2px solid rgba(15, 15, 15, 0.95);
}

main {
    max-width: 75%;
    margin: 7rem auto;
    padding: 0 2rem;
    text-align: center;
}

h1 {
    font-size: 2rem;
    margin-bottom: 3rem;
    font-weight: 500;
}

.input-container {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

textarea {
    width: 100%;
    min-height: 150px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    resize: none;
    outline: none;
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-start;
    align-items: center;
}

.action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.submit-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: white;
    padding: 1rem 1.75rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-left: auto;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.submit-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}


.resolution-select,
.fps-select {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: white;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
}

.resolution-select option,
.fps-select option {
    background: #1a1a2e;
    color: white;
}

.canvas-container {
    position: relative;
    margin-top: 20px;
    background: rgba(10, 6, 18, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
    width: 100%;
}

.canvas-toolbar {
    margin-bottom: 10px;
    gap: 10px;
    align-items: center;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.canvas-toolbar button {
    background: rgba(191, 95, 255, 0.1);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.canvas-toolbar button:hover {
    background: rgba(191, 95, 255, 0.2);
}

.loading-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 6, 18, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-popup.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(191, 95, 255, 0.3);
    border-radius: 50%;
    border-top: 5px solid #bf5fff;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #fff;
    font-size: 20px;
    margin-top: 15px;
    margin-bottom: 20px;
    min-height: 30px;
}

.progress-container {
    width: 80%;
    max-width: 500px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8c02ff, #bf5fff);
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Game styles */
.game-container {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    max-width: 330px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.2);
    display: none; /* Hidden by default, will be shown via JS */
}

.game-container.show {
    display: block;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.game-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 200;
}

.game-score {
    color: #bf5fff;
    font-weight: bold;
}

#gameCanvas {
    background: #111;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    border: 2px solid rgba(191, 95, 255, 0.3);
}

.game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

#startGameBtn {
    background: rgba(191, 95, 255, 0.2);
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#startGameBtn:hover {
    background: rgba(191, 95, 255, 0.4);
}

.game-instructions {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
}

.progress-percentage {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 15px;
}

.processing-messages {
    margin-top: 20px;
    max-width: 800px;
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}

.processing-messages::-webkit-scrollbar {
    width: 8px;
}

.processing-messages::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 8px;
}

.processing-messages::-webkit-scrollbar-thumb {
    background-color: #4a5568;
    border-radius: 8px;
    border: 2px solid #2d3748;
}

.processing-message {
    padding: 8px 12px;
    margin-bottom: 4px;
    animation: fadeIn 0.3s ease-in;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.processing-message:last-child {
    margin-bottom: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quiz Styles */
.quiz-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: left;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    border: 1px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.quiz-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-intro {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #a0aec0;
}

.quiz-questions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quiz-question {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.option {
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.option label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    width: 100%;
}

.option input[type="radio"] {
    accent-color: #a56ef7;
    width: 18px;
    height: 18px;
}

.question-feedback {
    margin-top: 0.8rem;
    padding: 0.8rem;
    border-radius: 4px;
    display: none;
}

.question-feedback.correct {
    display: block;
    background: rgba(72, 187, 120, 0.1);
    color: #48bb78;
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.question-feedback.incorrect {
    display: block;
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
    border: 1px solid rgba(245, 101, 101, 0.2);
}

.quiz-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.quiz-button {
    background: rgba(165, 110, 247, 0.1);
    color: #fff;
    border: 1px solid rgba(165, 110, 247, 0.2);
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.quiz-button:hover {
    background: rgba(165, 110, 247, 0.2);
    border-color: rgba(165, 110, 247, 0.3);
}

.quiz-results {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.quiz-results.show {
    display: block;
    background: rgba(165, 110, 247, 0.1);
    border: 1px solid rgba(165, 110, 247, 0.2);
}

@media (max-width: 768px) {
    .quiz-container {
        padding: 1rem;
    }

    .quiz-question {
        padding: 1rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .quiz-actions {
        flex-direction: column;
    }
}

.explanation-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: left;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    border: 1px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.explanation-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
}

.explanation-actions {
    display: flex;
    gap: 0.5rem;
}

.explanation-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.explanation-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.explanation-button svg {
    width: 16px;
    height: 16px;
}

.explanation-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #4a5568 #2d3748;
}

.explanation-content::-webkit-scrollbar {
    width: 6px;
}

.explanation-content::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 4px;
}

.explanation-content::-webkit-scrollbar-thumb {
    background-color: #4a5568;
    border-radius: 4px;
}

.explanation-content span {
    display: block;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
    padding: 0.5rem 0;
}

@media (max-width: 768px) {
    .explanation-container {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .explanation-content {
        max-height: 300px;
    }

    .explanation-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

.video-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    color: #e2e8f0;
    border: 1px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

.video-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.video-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.video-quality {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.video-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #a0aec0;
}

.video-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

@media (max-width: 768px) {
    .video-container {
        padding: 1rem;
        margin: 1rem;
    }

    .video-actions {
        flex-wrap: wrap;
    }

    .video-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .video-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

.error-message {
    color: #ff6b6b;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
}

@media (max-width: 600px) {
    main {
        margin: 4rem auto;
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .button-group {
        flex-wrap: wrap;
    }

    .submit-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .canvas-container {
        padding: 15px;
    }

    .canvas-toolbar {
        background: rgba(0, 0, 0, 0.5);
        padding: 10px 20px;
        border-radius: 30px;
    }


}

.drawing-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 10;
}

.canvas-wrapper {
    width: 100%;
    height: 300px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    resize: none;
}

#bgvid {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1000;
    background-size: cover;
    overflow: hidden;
    opacity: 0.5;
}

body {
    background-color: #000000;
    background: url("https://raw.githubusercontent.com/HishaamA/docmun/refs/heads/main/Group%202%20(1).png");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -999;
}

@media (max-width: 1024px) {
    main {
        max-width: 90%;
        margin: 6rem auto;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .button-group {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .resolution-select,
    .fps-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .new-gen-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    main {
        max-width: 100%;
        margin: 5rem auto 2rem;
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .input-container {
        padding: 1.5rem;
    }

    textarea {
        min-height: 120px;
        font-size: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .action-btn,
    .resolution-select,
    .fps-select,
    .submit-btn {
        width: 100%;
        justify-content: center;
    }

    .canvas-container {
        padding: 1rem;
        margin-top: 15px;
    }

    .canvas-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    .canvas-toolbar button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .explanation-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.8rem 1rem;
    }

    .header-right {
        gap: 0.8rem;
    }

    .profile-icon {
        width: 30px;
        height: 30px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .input-container {
        padding: 1rem;
        border-radius: 15px;
    }

    .canvas-container {
        padding: 0.5rem;
        margin-top: 10px;
    }

    .canvas-wrapper {
        width: 100%;
        height: 200px;
    }

    .drawing-status {
        font-size: 0.7rem;
    }

    .loading-text {
        font-size: 1rem;
    }

    .processing-messages {
        font-size: 0.8rem;
        padding: 8px;
    }
}

/* Add touch-friendly sizes */
@media (hover: none) and (pointer: coarse) {
    .action-btn,
    .submit-btn {
        padding: 1rem 1.5rem;
        min-height: 48px;
    }

    input[type="range"] {
        min-height: 32px;
    }

    .canvas-toolbar button {
        min-width: 60px;
        padding: 10px 15px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    main {
        margin: 4rem auto;
    }

    .input-container {
        padding: 1rem;
    }

    textarea {
        min-height: 80px;
    }

    .canvas-wrapper {
        height: 200px;
    }
}

/* Toggle switch styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-label {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: #8c02ff;
}

input:checked + .slider:before {
    transform: translateX(21px);
    background-color: #fff;
}

/* Hover effects */
.switch:hover .slider:before {
    box-shadow: 0 0 8px rgba(191, 95, 255, 0.4);
}

.toggle-container:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Optional: Add a small icon or text for ON/OFF states */
.slider:after {
    content: "OFF";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-weight: 600;
}

input:checked + .slider:after {
    content: "ON";
    left: 8px;
    right: auto;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .toggle-container {
        width: 100%;
        justify-content: space-between;
        padding: 10px 16px;
    }
}

/* Payment Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    /* Add padding to ensure modal doesn't touch screen edges */
    padding: 20px;
    /* Enable scrolling if content is too tall */
    overflow-y: auto;
}

.modal-content {
    background-color: #1a1a1a;
    margin: auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: modalFade 0.3s ease-in-out;
    /* Ensure modal content doesn't exceed viewport height */
    max-height: 90vh;
    overflow-y: auto;
    /* Add some spacing for better scrolling experience */
    margin: 20px 0;
}

/* Style the scrollbar for better visibility */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(165, 110, 247, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(165, 110, 247, 0.7);
}

@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        /* Adjust max-height for mobile */
        max-height: 85vh;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #fff;
}

.credit-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.package {
    cursor: pointer;
    padding: 15px;
    border: 1px solid #a56ef7;
    border-radius: 8px;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.package:hover {
    background-color: rgba(165, 110, 247, 0.1);
}

.package h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.package p {
    font-size: 1.5rem;
    color: #bf5fff;
    font-weight: bold;
}

#submit-button {
    background: #a56ef7;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    width: 100%;
    transition: all 0.3s ease;
}

#submit-button:hover {
    background: #bf5fff;
}

#submit-button:disabled {
    background: #666;
    cursor: not-allowed;
}

.payment-message {
    color: #fff;
    text-align: center;
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 0;
        padding: 20px;
    }

    .credit-packages {
        grid-template-columns: 1fr;
    }

    .package {
        padding: 15px;
    }
}



