/* --- Courses Page Specific Styles --- */
#courses {
    background-color: #f8f9fa; /* Bootstrap light gray */
}

.text-md-end {
    text-align: center !important;
}

/* Simple 2x2 Grid Course Cards Styling */
.course-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
    min-height: 300px;
    transition: box-shadow 0.2s ease;
}

.course-card:hover {
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.course-card .card-body {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Simple Icon Styling */
.course-icon-simple {
    text-align: center;
    margin-bottom: 1rem;
}

.course-icon-simple i {
    color: #0d6efd;
}

/* Course Title Styling */
.course-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* Simple Subject List Styling */
.course-subjects {
    text-align: left;
    max-width: 280px;
    margin: 0 auto;
}

.course-subjects li {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: #495057;
    font-weight: 400;
    display: flex;
    align-items: center;
}

.course-subjects li i {
    min-width: 16px;
    margin-right: 0.6rem !important;
    font-size: 0.7rem;
    color: #0d6efd;
}

/* Responsive Design for Mobile */
@media (max-width: 991.98px) {
    .course-card {
        min-height: auto;
        margin-bottom: 1.5rem;
    }
    
    .course-card .card-body {
        padding: 1.5rem 1rem;
    }
    
    .course-title {
        font-size: 1.1rem;
    }
    
    .course-subjects {
        max-width: 100%;
        padding: 0 0.5rem;
    }
}

@media (max-width: 576px) {
    .course-icon-simple i {
        font-size: 2rem !important;
    }
    
    .course-card .card-body {
        padding: 1.5rem 1rem;
    }
    
    .course-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .course-subjects li {
        font-size: 0.9rem;
        padding: 0.3rem 0;
    }
    
    .course-subjects li i {
        min-width: 14px;
        margin-right: 0.5rem !important;
        font-size: 0.6rem;
    }
}

/* Typewriter Effect Styles */-- Alternating Course Layout Styles --- */
.card-container {
    perspective: 1000px;
}

.course-card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-5px) rotateY(3deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.course-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-icon-large {
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.course-icon-large i {
    font-size: 4rem !important;
    transition: all 0.3s ease;
}

.course-card:hover .course-icon-large i {
    transform: scale(1.2) rotate(10deg);
}

.course-content {
    padding: 0.5rem;
}

.course-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.6rem;
    text-align: center;
    font-size: 1.7rem;
    position: relative;
}

/* Override text alignment for left/right positioned content */
.text-md-start .course-title {
    text-align: left;
}

.text-md-end .course-title {
    text-align: right;
}

.course-description {
    color: #6c757d;
    line-height: 1.7;
    text-align: center;
    padding: 0 0.6rem 0.6rem;
    margin-bottom: 0;
    font-size: 1rem;
}

/* Override text alignment for descriptions */
.text-md-start .course-description {
    text-align: left;
}

.text-md-end .course-description {
    text-align: right;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .course-card .card-body {
        padding: 1.5rem;
    }
    
    /* Mobile: Icons on top */
    .course-card .row {
        flex-direction: column !important;
    }
    
    .course-card .col-md-3,
    .course-card .col-md-9 {
        order: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Icon always appears first (top) in mobile */
    .course-card .col-md-3 {
        order: 1 !important;
        margin-bottom: 1rem;
    }
    
    /* Content always appears second (bottom) in mobile */
    .course-card .col-md-9 {
        order: 2 !important;
    }
    
    .course-icon-large {
        margin-bottom: 0;
    }
    
    .course-icon-large i {
        font-size: 1.5rem !important;
    }
    
    .course-title {
        font-size: 1.2rem;
        text-align: center !important;
    }
    
    .course-description {
        text-align: center !important;
        font-size: 1rem;
    }
    
    .text-md-end {
        text-align: center !important;
    }
}

/* --- Typewriter Effect Styles --- */
.typewriter-container {
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(13, 110, 253, 0.1);
}

.typewriter-text {
    font-size: 2.5rem;
    color: #333;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.typewriter-subject {
    color: #0d6efd !important;
    font-weight: 700 !important;
    min-width: 300px;
    display: inline-block;
    text-align: center;
    background: linear-gradient(45deg, #0d6efd, #6610f2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    width: 100%;
}

.typewriter-cursor {
    color: #0d6efd !important;
    animation: blink 1s infinite, pulse 2s infinite;
    font-weight: 900 !important;
    font-size: inherit;
    text-shadow: 0 0 15px rgba(13, 110, 253, 0.8), 0 0 5px rgba(13, 110, 253, 1);
    margin-left: 2px;
    opacity: 1;
    filter: brightness(1.2);
}

@keyframes blink {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

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

/* Add a subtle glow effect */
.typewriter-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0d6efd, #6610f2, #0d6efd);
    border-radius: 17px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}

.typewriter-container {
    position: relative;
}

/* --- Typewriter Effect Responsive Styles --- */
@media (max-width: 768px) {
    .typewriter-container {
        min-height: 80px;
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .typewriter-text {
        font-size: 1.8rem;
    }
    
    .typewriter-subject {
        min-width: 200px;
        width: 100%;
        text-align: center;
    }
    
    .typewriter-cursor {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .typewriter-container {
        min-height: 70px;
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .typewriter-text {
        font-size: 1.4rem;
    }
    
    .typewriter-subject {
        min-width: 150px;
        width: 100%;
        text-align: center;
    }
    
    .typewriter-cursor {
        font-size: 1.4rem;
    }
}

/* --- Simple Course Cards with Hover Effect --- */
.card-container {
    width: 100%;
    height: auto;
}

.card {
    background: #ffffff;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease-in-out;
    z-index: 1;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-icon-top {
    margin-bottom: 1rem;
    transition: all 0.3s ease-in-out;
    position: relative;
    z-index: 2;
}

.card-icon-top i {
    font-size: 3rem;
    color: #0d6efd;
    transition: all 0.3s ease-in-out;
}

.card:hover .card-icon-top i {
    transform: scale(1.2);
    color: #6610f2;
    filter: drop-shadow(0 0 15px rgba(13, 110, 253, 0.3));
}

.card-title {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease-in-out;
}

.card:hover .card-title {
    color: #0d6efd;
    transform: scale(1.05);
}

.card-text {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 0.95rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease-in-out;
}

.card:hover .card-text {
    color: #333;
    transform: translateY(-2px);
}

/* Enhanced hover effects for extracurricular cards */
.card:hover .text-success {
    color: #198754 !important;
    filter: drop-shadow(0 0 15px rgba(25, 135, 84, 0.3));
}

/* Pulse animation for icons on hover */
@keyframes pulse {
    0%, 100% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.3);
    }
}

.card:hover .card-icon-top i {
    animation: pulse 2s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }
    
    .card-icon-top i {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
}

.card-title {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.card-text {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.card-back h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.card-back .detail-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    width: 100%;
    padding: 0.3rem 0;
}

.card-back .detail-item i {
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.card-back small {
    margin-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.9;
    text-align: center;
    line-height: 1.4;
    display: block;
}

/* Hover glow effect */
.card-container:hover .card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Text color for extracurricular icons */
.text-success {
    color: #198754 !important;
}

.text-blue {
    color: #0d6efd !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-container {
        height: 280px;
    }
    
    .card-front, .card-back {
        padding: 1rem;
    }
    
    .card-icon-top i {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
}

/* Additional Animations to match skills page */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.course-card:hover {
    animation: float 2s ease-in-out infinite;
}