/* Reset dhe Fontet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 50px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

.login-box h2 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 300;
}

.login-hint {
    margin-top: 20px;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 10px;
    font-size: 14px;
    color: #666;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-create {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    background: white;
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-content h1 {
    color: #333;
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

.btn-logout {
    padding: 8px 20px;
    background: #ff6b6b;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #ff5252;
}

/* Create Test Section */
.create-test-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.create-test-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.create-test-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Tests Grid */
.tests-list-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.tests-list-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.no-tests {
    color: #888;
    text-align: center;
    padding: 40px 0;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.test-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.test-card.inactive {
    border-left-color: #ff6b6b;
    opacity: 0.7;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.test-header h3 {
    color: #333;
    font-size: 20px;
}

.test-status {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 15px;
}

.test-card.active .test-status {
    background: #d4edda;
    color: #155724;
}

.test-card.inactive .test-status {
    background: #f8d7da;
    color: #721c24;
}

.test-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.test-meta {
    display: flex;
    gap: 20px;
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.test-actions a,
.test-actions button {
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-edit:hover {
    background: #5a67d8;
}

.btn-toggle {
    background: #ffa502;
    color: white;
}

.btn-toggle:hover {
    background: #e69400;
}

.btn-results {
    background: #2ecc71;
    color: white;
}

.btn-results:hover {
    background: #27ae60;
}

.btn-copy {
    background: #3498db;
    color: white;
}

.btn-copy:hover {
    background: #2980b9;
}

.btn-back {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #7f8c8d;
}

.btn-preview {
    padding: 10px 20px;
    background: #2ecc71;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-preview:hover {
    background: #27ae60;
}

.test-link {
    background: #f0f4ff;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.test-link small {
    color: #666;
    word-break: break-all;
}

/* Edit Test Page */
.edit-test-container {
    max-width: 1400px;
    margin: 0 auto;
}

.edit-content {
    display: grid;
    gap: 30px;
}

.add-question-section,
.questions-list,
.result-messages-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.add-question-section h2,
.questions-list h2,
.result-messages-section h2 {
    color: #333;
    margin-bottom: 20px;
}

/* Add Question Header */
.add-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-import {
    padding: 10px 20px;
    background: #2ecc71;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-import:hover {
    background: #27ae60;
}

.options-group {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.options-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.option-row input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
}

.option-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-weight: normal;
}

.btn-add-option {
    padding: 10px 20px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add-option:hover {
    background: #27ae60;
}

.btn-remove {
    padding: 5px 10px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-remove:hover {
    background: #ff5252;
}

/* Questions List */
.questions-list-items {
    display: grid;
    gap: 20px;
}

.no-questions {
    color: #888;
    text-align: center;
    padding: 30px 0;
}

.question-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.question-number {
    font-weight: 700;
    color: #667eea;
}

.question-points {
    padding: 4px 12px;
    background: #ffd93d;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
}

.question-type {
    padding: 4px 12px;
    background: #a29bfe;
    color: white;
    border-radius: 15px;
    font-size: 12px;
    text-transform: uppercase;
}

.question-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-edit-question {
    padding: 5px 12px;
    background: #3498db;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-edit-question:hover {
    background: #2980b9;
}

.btn-delete {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 20px;
    transition: color 0.3s;
}

.btn-delete:hover {
    color: #ff5252;
}

.question-text {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.question-options {
    display: grid;
    gap: 8px;
}

.option-item {
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-item.correct {
    background: #d4edda;
    border-color: #28a745;
}

.correct-badge {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

/* Result Messages */
.result-messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.message-range {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.message-range h4 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Test Page (Student) */
.test-container {
    max-width: 800px;
    margin: 0 auto;
}

.test-info-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.test-info-box h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.test-info-box p {
    color: #666;
    margin-bottom: 30px;
}

.question-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.question-header {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

.question-content h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 25px;
}

.options-list {
    display: grid;
    gap: 12px;
    margin-bottom: 25px;
}

.options-list .option-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.options-list .option-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.options-list .option-item input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.options-list .option-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.option-text {
    flex: 1;
}

.option-text img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
}

.image-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.image-option {
    text-align: center;
}

.image-option label {
    cursor: pointer;
}

.image-option img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid #e0e0e0;
    transition: all 0.3s;
}

.image-option input[type="radio"]:checked + img {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.btn-next {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Result Page */
.result-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.result-box {
    background: white;
    border-radius: 20px;
    padding: 50px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.result-box h1 {
    color: #333;
    margin-bottom: 20px;
}

.result-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.stat-label {
    display: block;
    color: #888;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.result-message {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.result-message p {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.result-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #667eea;
    transition: all 0.3s;
}

.result-link:hover {
    background: #667eea;
    color: white;
}

.btn-home {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Import Page */
.import-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.info-box h3 {
    color: #333;
    margin-bottom: 15px;
}

.info-box pre {
    background: #2d3436;
    color: #dfe6e9;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    margin: 10px 0;
}

.btn-download {
    display: inline-block;
    padding: 8px 15px;
    background: #3498db;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-download:hover {
    background: #2980b9;
}

.upload-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.upload-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.current-questions {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.current-questions h3 {
    color: #333;
}

.btn-view {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-view:hover {
    background: #5a67d8;
}

.message-container {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
}

.message-container .success {
    color: #155724;
    background: #d4edda;
    padding: 15px;
    border-radius: 8px;
}

.message-container .error {
    color: #721c24;
    background: #f8d7da;
    padding: 15px;
    border-radius: 8px;
}

.message-container .errors {
    color: #856404;
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-box,
    .result-box {
        padding: 30px 20px;
    }
    
    .dashboard-header {
        padding: 15px 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-content h1 {
        font-size: 22px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .create-test-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .test-card {
        padding: 20px;
    }
    
    .test-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .test-actions {
        flex-direction: column;
    }
    
    .test-actions a,
    .test-actions button {
        width: 100%;
        text-align: center;
    }
    
    .edit-test-container {
        padding: 0 10px;
    }
    
    .add-question-section,
    .questions-list,
    .result-messages-section {
        padding: 20px;
    }
    
    .question-container {
        padding: 20px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .result-messages-grid {
        grid-template-columns: 1fr;
    }
    
    .option-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .question-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .question-content h3 {
        font-size: 18px;
    }
    
    .import-section {
        grid-template-columns: 1fr;
    }
    
    .add-question-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-box {
        padding: 20px 15px;
    }
    
    .result-box {
        padding: 20px 15px;
    }
    
    .test-info-box {
        padding: 20px;
    }
    
    .question-container {
        padding: 15px;
    }
    
    .progress-info {
        font-size: 14px;
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .options-list .option-item {
        padding: 12px;
    }
    
    .image-options {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .test-card {
        padding: 15px;
    }
}

.btn-import {
    padding: 10px 20px;
    background: #2ecc71;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-import:hover {
    background: #27ae60;
}

.btn-reset-students {
    background: #fd79a8;
    color: white;
}

.btn-reset-students:hover {
    background: #e84393;
}

.btn-delete-test {
    background: #ff6b6b;
    color: white;
}

.btn-delete-test:hover {
    background: #ff5252;
}