 :root {
            /* Colors */
            --primary-color: #fd3132;
            --primary-hover: #d50404;
            --primary-light: rgba(253, 49, 50, 0.1);
            --secondary-color: #2a3d66;
            --secondary-hover: #16274b;
            --secondary-light: rgba(42, 61, 102, 0.1);
            --text-color: #333333;
            --text-light: #666666;
            --white: #ffffff;
            --light-gray: #f8f9fa;
            --mid-gray: #e9ecef;
            --dark-gray: #adb5bd;
            --success-color: #10B981;
            --error-color: #EF4444;
            --warning-color: #F59E0B;
            --info-color: #06B6D4;
            
            /* Typography */
            --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            --font-size-sm: 0.875rem;
            --font-size-base: 1rem;
            --font-size-lg: 1.125rem;
            
            /* Spacing */
            --header-height: 70px;
            --timer-height: 50px;
            --border-radius: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-family);
            background-color: var(--light-gray);
            color: var(--text-color);
            font-size: var(--font-size-base);
            overflow-x: hidden;
        }

        /* Header Styles */
        header {
            background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
            color: var(--white);
            height: var(--header-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 1.5rem;
            box-shadow: var(--shadow);
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 2rem;
        }

        .logo {
            color: var(--white);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: var(--font-size-lg);
        }

        .logo i {
            font-size: 1.5rem;
        }

        nav {
            display: flex;
            gap: 1rem;
        }

        nav a {
            color: var(--white);
            text-decoration: none;
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
            opacity: 0.8;
        }

        nav a:hover,
        nav a.active {
            background: rgba(255, 255, 255, 0.2);
            opacity: 1;
        }

        .header-right {
            display: flex;
            gap: 0.5rem;
        }

        .header-right a {
            color: var(--white);
            text-decoration: none;
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.1);
            font-size: var(--font-size-sm);
        }

        .header-right a:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        /* Timer Bar */
        .timer-bar {
            background: var(--white);
            height: var(--timer-height);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            position: fixed;
            top: var(--header-height);
            left: 0;
            right: 0;
            z-index: 999;
        }

        .timer {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            color: var(--primary-color);
            font-size: var(--font-size-lg);
        }

        .timer.warning {
            color: var(--warning-color);
        }

        .timer.danger {
            color: var(--error-color);
        }

        /* Main Content */
        .main-content {
            margin-top: 70px;
            height: calc(100vh - var(--header-height) - var(--timer-height));
            display: flex;
            flex-direction: column;
            margin-bottom: 70px;
        }

        /* Part Navigation */
        .part-navigation {
            background: var(--white);
            padding: 1rem;
            border-bottom: 1px solid var(--mid-gray);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .part-tabs {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .part-tab {
            background: var(--light-gray);
            border: 1px solid var(--mid-gray);
            color: var(--text-color);
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: var(--font-size-sm);
            font-weight: 500;
        }

        .part-tab:hover {
            background: var(--primary-light);
            border-color: var(--primary-color);
        }

        .part-tab.active {
            background: var(--primary-color);
            color: var(--white);
            border-color: var(--primary-color);
        }

        .nav-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .nav-btn {
            background: var(--secondary-color);
            color: var(--white);
            border: none;
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: var(--font-size-sm);
            transition: all 0.3s ease;
        }

        .nav-btn:hover {
            background: var(--secondary-hover);
        }

        .nav-btn:disabled {
            background: var(--dark-gray);
            cursor: not-allowed;
        }

        .submit-btn {
            background: var(--success-color);
            color: var(--white);
        }

        .submit-btn:hover {
            background: #059669;
        }

        /* Test Container */
        .test-container {
            flex: 1;
            display: flex;
            background: var(--white);
            margin: 1rem;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            overflow: hidden;
            position: relative;
        }

        .content-panel {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem;
            position: relative;
        }

        .questions-panel {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem;
            border-left: 1px solid var(--mid-gray);
            position: relative;
        }

        .panel-header {
            background: var(--secondary-color);
            color: var(--white);
            padding: 1rem 1.5rem;
            margin: -1.5rem -1.5rem 1.5rem -1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
        }

        /* Resizer */
       .resizer {
    width: 8px;
    background: #000000;
    cursor: col-resize;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.resizer:hover {
    background: #333333;
}

.resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 60px;
    background: #ffffff;
    border-radius: 2px;
    opacity: 0.8;
}

.resizer:hover::after {
    opacity: 1;
}

        /* Content Styles */
        .passage-content {
            line-height: 1.7;
            font-size: var(--font-size-base);
            color: var(--text-color);
        }

        .passage-content h1,
        .passage-content h2,
        .passage-content h3 {
            color: var(--secondary-color);
            margin: 1.5rem 0 1rem 0;
            font-weight: 600;
        }

        .passage-content p {
            margin-bottom: 1rem;
        }

        .passage-content img {
            max-width: 100%;
            height: auto;
            margin: 1rem 0;
            border-radius: var(--border-radius);
        }

        .highlighted-text {
            background-color: #ffeb3b;
            padding: 2px 4px;
            border-radius: 3px;
        }

        /* Text Selection Menu */
        .selection-menu {
            position: absolute;
            background: var(--white);
            border: 1px solid var(--mid-gray);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            display: none;
            z-index: 1000;
            padding: 0.5rem;
            gap: 0.5rem;
        }

        .selection-btn {
            background: none;
            border: none;
            padding: 0.5rem;
            border-radius: var(--border-radius);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: var(--font-size-sm);
            transition: all 0.3s ease;
        }

        .selection-btn:hover {
            background: var(--light-gray);
        }

        /* Question Styles */
        .question-item {
            background: var(--white);
            border: 1px solid var(--mid-gray);
            border-radius: var(--border-radius);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: all 0.3s ease;
        }

        .question-item:hover {
            box-shadow: var(--shadow);
        }

        .question-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--mid-gray);
        }

        .question-number {
            background: var(--primary-color);
            color: var(--white);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: var(--font-size-sm);
            font-weight: 600;
        }

        .question-type {
            background: var(--secondary-light);
            color: var(--secondary-color);
            padding: 0.25rem 0.75rem;
            border-radius: 15px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .marks-info {
            background: var(--info-color);
            color: var(--white);
            padding: 0.25rem 0.5rem;
            border-radius: 10px;
            font-size: 0.75rem;
        }

        .question-text {
            margin-bottom: 1rem;
            line-height: 1.6;
        }

        /* MCQ Options */
        .mcq-options {
            list-style: none;
            padding: 0;
        }

        .mcq-option {
            margin-bottom: 0.75rem;
            padding: 0.75rem;
            border: 2px solid var(--mid-gray);
            border-radius: var(--border-radius);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .mcq-option:hover {
            border-color: var(--primary-color);
            background: var(--primary-light);
        }

        .mcq-option.selected {
            border-color: var(--primary-color);
            background: var(--primary-light);
        }

        .option-label {
            font-weight: 600;
            color: var(--secondary-color);
            min-width: 20px;
        }

        /* Fill in the blanks */
        .fill-input {
            border: 1px solid var(--primary-color);
            border-radius: 4px;
            padding: 0.25rem 0.5rem;
            margin: 0 0.25rem;
            min-width: 60px;
            max-width: 120px;
            font-size: var(--font-size-sm);
            text-align: center;
            transition: all 0.3s ease;
        }

        .fill-input:focus {
            outline: none;
            border-color: var(--primary-hover);
            box-shadow: 0 0 0 2px var(--primary-light);
        }

        .question-number-label {
            background: var(--primary-color);
            color: var(--white);
            padding: 0.125rem 0.375rem;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-right: 0.25rem;
            display: inline-block;
        }

        /* Dropdown */
        .dropdown-container {
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .dropdown-select {
            border: 1px solid var(--primary-color);
            border-radius: var(--border-radius);
            padding: 0.5rem;
            background: var(--white);
            font-size: var(--font-size-sm);
            min-width: 120px;
        }

        .dropdown-select:focus {
            outline: none;
            border-color: var(--primary-hover);
            box-shadow: 0 0 0 2px var(--primary-light);
        }

        /* True/False Options */
        .tf-options {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .tf-option {
            flex: 1;
            min-width: 100px;
            padding: 0.75rem;
            border: 2px solid var(--mid-gray);
            border-radius: var(--border-radius);
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .tf-option:hover {
            border-color: var(--primary-color);
            background: var(--primary-light);
        }

        .tf-option.selected {
            border-color: var(--primary-color);
            background: var(--primary-color);
            color: var(--white);
        }

        /* Table Styles */
        .table-fill {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
        }

        .table-fill th,
        .table-fill td {
            border: 1px solid var(--mid-gray);
            padding: 0.75rem;
            text-align: left;
        }

        .table-fill th {
            background: var(--light-gray);
            font-weight: 600;
            color: var(--secondary-color);
        }

        .table-fill-input {
            border: 1px solid var(--primary-color);
            border-radius: 4px;
            padding: 0.25rem 0.5rem;
            min-width: 80px;
            font-size: var(--font-size-sm);
            text-align: center;
        }

        /* Loading State */
        .loading-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 200px;
            gap: 1rem;
            color: var(--text-light);
        }

        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 4px solid var(--mid-gray);
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Progress Bar */
        .progress-container {
            background: var(--white);
            padding: 1rem;
            margin: 0 1rem;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            margin-bottom: 0.5rem;
        }

        .progress-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
            font-size: var(--font-size-sm);
            color: var(--text-light);
        }

        .progress-bar {
            height: 6px;
            background: var(--mid-gray);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), var(--success-color));
            transition: width 0.3s ease;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .header-left nav {
                display: none;
            }

            .header-right span {
                display: none;
            }

            .part-navigation {
                flex-direction: column;
                gap: 0.5rem;
            }

            .part-tabs {
                width: 100%;
                overflow-x: auto;
                padding-bottom: 0.5rem;
            }

            .part-tabs::-webkit-scrollbar {
                height: 4px;
            }

            .part-tabs::-webkit-scrollbar-track {
                background: var(--light-gray);
            }

            .part-tabs::-webkit-scrollbar-thumb {
                background: var(--primary-color);
                border-radius: 2px;
            }

            .test-container {
                flex-direction: column;
                margin: 0.5rem;
            }

            .content-panel,
            .questions-panel {
                border: none;
                border-bottom: 1px solid var(--mid-gray);
            }

            .questions-panel {
                border-left: none;
                border-top: 1px solid var(--mid-gray);
            }

            .resizer {
                display: none;
            }

        .mobile-resizer {
    height: 8px;
    background: #000000;
    cursor: row-resize;
    position: relative;
    display: block;
    flex-shrink: 0;
}

.mobile-resizer:hover {
    background: #333333;
}

.mobile-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 4px;
    background: #ffffff;
    border-radius: 2px;
    opacity: 0.8;
}

.mobile-resizer:hover::after {
    opacity: 1;
}

            .tf-options {
                flex-direction: column;
            }

            .dropdown-container {
                flex-direction: column;
                align-items: flex-start;
            }
        }

        /* Audio Player */
        .audio-player {
            width: 100%;
            margin: 1rem 0;
            border-radius: var(--border-radius);
            overflow: hidden;
        }

        .audio-player iframe {
            width: 100%;
            height: 200px;
            border: none;
        }

        .audio-description {
            background: var(--light-gray);
            padding: 1rem;
            border-radius: var(--border-radius);
            margin: 1rem 0;
        }

        .audio-description h6 {
            color: var(--secondary-color);
            margin-bottom: 0.5rem;
        }

        /* Instructions */
        .instructions {
            background: var(--secondary-light);
            border-left: 4px solid var(--secondary-color);
            padding: 1rem;
            border-radius: var(--border-radius);
            margin-bottom: 1.5rem;
        }

        .instructions h6 {
            color: var(--secondary-color);
            margin-bottom: 0.5rem;
        }

        /* Modal Styles */
        .modal-content {
            border-radius: var(--border-radius);
            border: none;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        .modal-header {
            background: var(--primary-color);
            color: var(--white);
            border-radius: var(--border-radius) var(--border-radius) 0 0;
        }

        .btn-close {
            filter: invert(1);
        }

        /* Custom Alert and Confirm Dialogs */
        .custom-dialog-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .custom-dialog-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .custom-dialog {
            background: var(--white);
            border-radius: var(--border-radius);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            max-width: 500px;
            width: 90%;
            margin: 1rem;
            transform: scale(0.7);
            transition: transform 0.3s ease;
        }

        .custom-dialog-overlay.show .custom-dialog {
            transform: scale(1);
        }

        .custom-dialog-header {
            padding: 1.5rem 1.5rem 1rem 1.5rem;
            border-bottom: 1px solid var(--mid-gray);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .custom-dialog-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        .custom-dialog-icon.success {
            background: var(--success-color);
            color: var(--white);
        }

        .custom-dialog-icon.error {
            background: var(--error-color);
            color: var(--white);
        }

        .custom-dialog-icon.warning {
            background: var(--warning-color);
            color: var(--white);
        }

        .custom-dialog-icon.info {
            background: var(--info-color);
            color: var(--white);
        }

        .custom-dialog-title {
            flex: 1;
        }

        .custom-dialog-title h5 {
            margin: 0;
            color: var(--text-color);
            font-weight: 600;
        }

        .custom-dialog-body {
            padding: 1rem 1.5rem;
            color: var(--text-light);
            line-height: 1.6;
        }

        .custom-dialog-footer {
            padding: 1rem 1.5rem 1.5rem 1.5rem;
            display: flex;
            gap: 0.75rem;
            justify-content: flex-end;
        }

        .custom-dialog-btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: var(--border-radius);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .custom-dialog-btn.primary {
            background: var(--primary-color);
            color: var(--white);
        }

        .custom-dialog-btn.primary:hover {
            background: var(--primary-hover);
        }

        .custom-dialog-btn.secondary {
            background: var(--mid-gray);
            color: var(--text-color);
        }

        .custom-dialog-btn.secondary:hover {
            background: var(--dark-gray);
        }

        .custom-dialog-btn.success {
            background: var(--success-color);
            color: var(--white);
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: var(--light-gray);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--dark-gray);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary-color);
        }