/* Custom styles for D365 Training Maturity Model */

/* Typography */
body {
    background-color: white;
    font-family: 'Manrope', sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6, .display-4, .display-5, .display-6, .card-title, .card-header h4 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
}

.jumbotron {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 0;
    margin-bottom: 0;
}

/* Assessment step cards */
.assessment-step {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.assessment-step.active {
    display: block;
}

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

.step-card {
    border: none;
    background-color: #F9F6F3;
    border-radius: 12px;
    box-shadow: none;
    transition: transform 0.2s ease;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Rating container */
.rating-container {
    text-align: center;
}

/* Rating buttons */
.rating-btn {
    min-width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #dee2e6;
    background: white;
    color: #6c757d;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.rating-btn:hover {
    transform: scale(1.1);
    border-color: #007bff;
    color: #007bff;
}

.rating-btn.selected {
    background-color: #5CCEF0;
    border-color: #5CCEF0;
    color: #212529;
    transform: scale(1.1);
}

.rating-btn.selected:hover {
    background-color: #4AB8D8;
    border-color: #4AB8D8;
    color: #212529;
}

/* Rating labels */
.rating-label {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 8px;
    text-align: center;
    font-weight: 600;
}

/* Progress bar styling */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Score display */
.score-display {
    text-align: center;
    margin: 20px 0;
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    color: #007bff;
}

.score-max {
    font-size: 1.5rem;
    color: #6c757d;
}

/* Maturity level badges */
.maturity-badge .badge {
    font-size: 1.2rem;
    padding: 10px 20px;
}

/* Step breakdown table */
.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

/* Desktop - 8 boxes in one row */
@media (min-width: 1200px) {
    .step-box {
        height: 110px;
    }
    
    .step-box-title {
        font-size: 1.1rem;
    }
    
    .step-box-number {
        font-size: 0.6rem;
    }
}

/* iPad - 4 boxes per row (2 rows) */
@media (min-width: 768px) and (max-width: 1199px) {
    .step-box {
        height: 100px;
    }
    
    .step-box-title {
        font-size: 1rem;
    }
    
    .step-box-number {
        font-size: 0.6rem;
    }
}

/* iPad Pro and larger tablets */
@media (min-width: 1024px) and (max-width: 1199px) {
    .step-box {
        height: 105px;
    }
    
    .step-box-title {
        font-size: 1.1rem;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .jumbotron h1 {
        font-size: 2rem;
    }
    
    .jumbotron .lead {
        font-size: 1rem;
    }
    
    .rating-btn {
        min-width: 45px;
        height: 45px;
        font-size: 0.9rem;
        margin: 0 auto;
    }
    
    /* Reduce button spacing for mobile */
    .rating-container .row {
        margin-bottom: 0.5rem !important;
    }
    
    .rating-container .col-6 {
        margin-bottom: 0.5rem !important;
    }
    
    .rating-label {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
    
    .step-card .card-body {
        padding: 1rem;
    }
    
    /* Reduce header size for mobile */
    .card {
        margin-bottom: 1rem;
    }
    
    #appTitle {
        font-size: 1.2rem !important;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .step-box {
        height: 100px;
        padding: 0.75rem;
    }
    
    .step-box-title {
        font-size: 0.9rem;
    }
    
    .step-box-number {
        font-size: 0.6rem;
    }
    
    .step-box-icon {
        font-size: 1.2rem;
    }
    
    .step-box-grade {
        width: 33px;
        height: 33px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0;
    }
    
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 1.5rem;
    }
    
    .rating-btn {
        min-width: 48px !important;
        height: 48px !important;
        font-size: 0.85rem !important;
        margin: 0 auto;
    }
    
    /* Further reduce button spacing for small mobile */
    .rating-container .row {
        margin-bottom: 0.1rem !important;
    }
    
    .rating-container .col-6 {
        margin-bottom: 0.1rem !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .rating-container .mb-3 {
        margin-bottom: 0.1rem !important;
    }
    
    .rating-container .justify-content-center {
        gap: 0.25rem;
    }
    
    /* Override Bootstrap spacing for rating buttons */
    .rating-container .row {
        margin-left: -0.25rem !important;
        margin-right: -0.25rem !important;
    }
    
    /* Reduce spacing between step boxes for small mobile only */
    .col-3, .col-md-3, .col-lg {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .row {
        margin-left: -0.25rem !important;
        margin-right: -0.25rem !important;
    }
    
    .rating-label {
        font-size: 0.9rem !important;
        text-align: center;
    }
    
    /* Style selected rating description */
    .rating-desc {
        font-size: 0.9rem !important;
        margin-top: 1rem !important;
        text-align: left !important;
    }
    
    /* Reduce navigation button sizes for small mobile */
    .nav-buttons .btn {
        min-width: 60px !important;
        font-size: 0.8rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Reduce step dot sizes for small mobile */
    .step-dot {
        width: 8px !important;
        height: 8px !important;
        margin: 0 2px !important;
    }
    
    .step-dot.active {
        transform: scale(1.1) !important;
    }
    
    /* Fix vertical alignment of step dots container */
    .step-indicator {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        gap: 0.25rem !important;
    }
    
    /* Adjust Assessment Dashboard header spacing for small mobile */
    .card-body {
        padding-top: 1rem !important;
    }
    
    .card-title.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .score-number {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .step-box {
        height: 100px;
        padding: 0.4rem;
    }
    
    .step-box-title {
        font-size: 0.85rem;
    }
    
    .step-box-number {
        font-size: 0.4rem;
    }
    
    .step-box-icon {
        font-size: 0.9rem;
    }
    
    .step-box-grade {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    /* Reduce step content font sizes for small mobile */
    .card-header h4 {
        font-size: 0.9rem; /* Step headers */
    }
    
    .card-body p {
        font-size: 0.9rem; /* Description text */
    }
    
    .card-body h5 {
        font-size: 0.9rem; /* Question text */
    }
    
    /* Reduce Generate Report button font size for small mobile */
    #emailReportBtn {
        font-size: 0.8rem;
    }
    
    /* Further reduce header size for small mobile */
    #appTitle {
        font-size: 1rem !important;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 0.5rem;
    }
    
    /* Reduce spacing between header and assessment dashboard */
    header.row {
        margin-bottom: 0.5rem !important;
    }
    
    /* Reduce spacing between assessment dashboard and question box */
    .row.mb-4 {
        margin-bottom: 0.5rem !important;
    }
    
    /* Make rating buttons 2x2 grid for small mobile using CSS Grid */
    .rating-container .row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 0.5rem !important;
        justify-content: start !important;
    }
    
    .rating-container .col-6 {
        width: auto !important;
        max-width: none !important;
        flex: none !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
    }
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-buttons .btn {
    min-width: 120px;
    font-size: 1rem;
}

.btn-primary {
    background-color: transparent;
    border-color: #5CCEF0;
    color: #5CCEF0;
}

.btn-primary:hover {
    background-color: #5CCEF0;
    border-color: #5CCEF0;
    color: white;
}

.btn-outline-secondary {
    border-color: #5CCEF0;
    color: #5CCEF0;
}

.btn-outline-secondary:hover {
    background-color: #5CCEF0;
    border-color: #5CCEF0;
    color: #212529;
}

@media (max-width: 768px) {
    .nav-buttons {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .nav-buttons .btn {
        min-width: 80px;
        padding: 0.5rem 1rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Step Dashboard */
.step-dashboard {
    margin-bottom: 1rem;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.step-indicator {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dee2e6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-dot.active {
    background-color: #5CCEF0;
    transform: scale(1.2);
    border: 2px solid #5CCEF0;
}

.step-dot.completed {
    background-color: #28a745;
}

/* Email Report Button */
#emailReportBtn {
    border-color: #5CCEF0;
    color: #5CCEF0;
    transition: all 0.3s ease;
}

#emailReportBtn:hover:not(:disabled) {
    background-color: #5CCEF0;
    border-color: #5CCEF0;
    color: white;
}

#emailReportBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#emailReportBtn:not(:disabled) {
    background-color: #5CCEF0;
    border-color: #5CCEF0;
    color: white;
    font-weight: bold;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(92, 206, 240, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.card {
    background-color: #F9F6F3;
    border: none;
    box-shadow: none;
}

.card-header {
    background-color: #F9F6F3;
    border-bottom: none;
}

.step-box {
    background: #F9F6F3;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

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

.step-box:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.step-box.active {
    border-color: #5CCEF0;
    background: #5CCEF0;
    color: white;
}

.step-box.completed {
    border-color: #28a745;
    background: #F9F6F3;
    color: #28a745;
}

.step-box-number {
    font-size: 0.7rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    opacity: 0.8;
}

.step-box-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.step-box-grade {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.step-box-grade.level-1 {
    background-color: #dc3545;
}

.step-box-grade.level-2 {
    background-color: #ffc107;
    color: #212529;
}

.step-box-grade.level-3 {
    background-color: #007bff;
}

.step-box-grade.level-4 {
    background-color: #28a745;
}

.step-box-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}


/* Step indicators */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dee2e6;
    margin: 0 5px;
    transition: background-color 0.3s ease;
}

.step-dot.active {
    background-color: #007bff;
}

.step-dot.completed {
    background-color: #28a745;
}

/* Score circle */
.score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
}

.score-circle.level-1 {
    background-color: #dc3545; /* Red */
}

.score-circle.level-2 {
    background-color: #ffc107; /* Yellow */
    color: #212529;
}

.score-circle.level-3 {
    background-color: #007bff; /* Blue */
}

.score-circle.level-4 {
    background-color: #28a745; /* Green */
}

.score-circle.level-0 {
    background-color: #6c757d; /* Dark Gray */
}

/* Results section animations */
#resultsSection {
    animation: slideUp 0.5s ease-out;
}

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