/* Course Recommendation Tool - Material Design Styles */

* {
    box-sizing: border-box;
}

/* Trigger Button */
.crt-trigger-btn {
    background: #1976d2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.crt-trigger-btn:hover {
    background: #1565c0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.crt-trigger-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.crt-trigger-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.crt-trigger-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Modal */
.crt-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.crt-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.crt-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 24px 38px rgba(0,0,0,0.14), 0 9px 46px rgba(0,0,0,0.12), 0 11px 15px rgba(0,0,0,0.2);
    font-family: 'Roboto', sans-serif;
    animation: slideUp 0.3s ease-out;
}

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

/* Modal Header */
.crt-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.crt-modal-header h2 {
    margin: 0;
    color: #212121;
    font-size: 20px;
    font-weight: 500;
}

.crt-close-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: #757575;
    transition: all 0.2s ease;
}

.crt-close-btn:hover {
    background: rgba(0,0,0,0.04);
    color: #212121;
}

/* Progress Bar */
.crt-progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    position: relative;
    overflow: hidden;
}

.crt-progress-fill {
    height: 100%;
    background: #1976d2;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.crt-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .2) 50%,
        rgba(255, 255, 255, .2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* Modal Body */
.crt-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Quiz Question */
.crt-question {
    margin-bottom: 32px;
}

.crt-question h3 {
    color: #212121;
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.crt-question-number {
    color: #1976d2;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Answer Options */
.crt-options {
    display: grid;
    gap: 12px;
}

.crt-option {
    position: relative;
}

.crt-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.crt-option label {
    display: block;
    padding: 16px 20px;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.crt-option label:hover {
    background: #f5f5f5;
    border-color: #bdbdbd;
}

.crt-option input[type="radio"]:checked + label {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #1976d2;
}

.crt-option input[type="radio"]:checked + label::after {
    content: 'check';
    font-family: 'Material Icons';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #1976d2;
    font-size: 20px;
}

/* Results */
.crt-results {
    text-align: center;
}

.crt-results h3 {
    color: #212121;
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 24px 0;
}

.crt-platform {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    text-align: left;
    transition: all 0.2s ease;
}

.crt-platform:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.crt-platform h4 {
    color: #1976d2;
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.crt-platform p {
    color: #616161;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.crt-platform-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1976d2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.crt-platform-link:hover {
    color: #1565c0;
}

/* Modal Footer */
.crt-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

/* Buttons */
.crt-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 64px;
    justify-content: center;
}

.crt-btn-primary {
    background: #1976d2;
    color: white;
}

.crt-btn-primary:hover {
    background: #1565c0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.crt-btn-secondary {
    color: #1976d2;
}

.crt-btn-secondary:hover {
    background: rgba(25, 118, 210, 0.04);
}

.crt-btn:disabled {
    background: #e0e0e0 !important;
    color: #9e9e9e !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .crt-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .crt-modal-header,
    .crt-modal-body,
    .crt-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .crt-modal-header h2 {
        font-size: 18px;
    }
    
    .crt-question h3 {
        font-size: 16px;
    }
    
    .crt-modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .crt-modal-footer .crt-btn {
        width: 100%;
    }
}

/* Loading Animation */
.crt-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Fade transitions */
.crt-fade-in {
    animation: fadeInUp 0.3s ease-out;
}

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

.crt-fade-out {
    animation: fadeOut 0.2s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
