/* ===================================================================
   UMS PROJECT - CUSTOM CSS STYLESHEET
   ================================================================ */

/* ===================================================================
   1. CSS RESET & BASE STYLES
   ================================================================ */
* {
    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: 90vh;
    color: #c3d6ec;
    line-height: 1.6;
}

/* ===================================================================
   2. LAYOUT & CONTAINERS
   ================================================================ */
.container {
    max-width: 90vw;
    margin: 0 auto;
    padding: 20px;
}

.page-wrapper {
    background: #16171c;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: auto;
}

/* ===================================================================
   3. TYPOGRAPHY
   ================================================================ */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #c3d6ec;
    text-align: center;
    position: relative;
}

.page-title-grid {
    display: grid;
    grid-template-columns: 1fr 5fr 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #e8f4fd;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    text-align: center;
}

/* ===================================================================
   4. NAVIGATION & LINKS
   ================================================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 25px;
    background: rgba(102, 126, 234, 0.1);
}

.back-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(-5px);
}

/* ===================================================================
   5. BUTTON STYLES
   ================================================================ */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #121212;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Back Button with Animation */
.btn-back {
    background: #121212;
    color: #d6d6d6;
    border: 2px solid #667eea;
    width: 200px;
    height: 56px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    cursor: pointer;
}

.btn-back .btn-bg {
    background: #4CAF50;
    border-radius: 10px;
    height: 52px;
    width: 25%;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back:hover .btn-bg {
    width: 100%;
}

.btn-back .btn-text {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.btn-back:hover .btn-text {
    color: #d6d6d6;
    opacity: 0;
}

/* ===================================================================
   6. CARD SYSTEM
   ================================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    min-height: 300px;
}

.card {
    background: linear-gradient(145deg, #121212, #1a1a1a);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease forwards;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(102, 126, 234, 0.2);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover::after {
    opacity: 1;
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #e8f4fd;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    padding-bottom: 0.8rem;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.card-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.card-left {
    flex: 0.4;
    font-size: 0.95rem;
    line-height: 1.6;
}


.card-right {
    flex: 0.5;
    text-align: right;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 500;
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
}

.card-left p {
    margin: 0.8rem 0;
    color: #d1e7dd;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.2s ease;
}

.card-left p:last-child {
    border-bottom: none;
}

.card-left strong {
    color: #667eea;
    font-weight: 600;
    display: inline-block;
    font-size: 1rem;
}


.card-right p {
    margin: 0.4rem 0;
    padding: 0.3rem 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #d1e7dd;
}

.card-right strong {
    color: #e8f4fd;
}

.grade-info {
    min-width: fit-content
}

/* ===================================================================
   7. INFO SECTIONS
   ================================================================ */
.info-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    min-height: 200px;
}

.info-section {
    background: linear-gradient(145deg, #121212, #1a1a1a);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-left: 6px solid #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(102, 126, 234, 0.2);
}

.info-section:hover::before {
    opacity: 1;
}

.info-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #e8f4fd;
    padding-bottom: 1rem;
    border-bottom: 3px solid rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}


.info-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d1e7dd;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.2s ease;
}

.info-section p strong {
    color: #667eea;
    font-weight: 600;
    display: inline-block;
    min-width: 50px;
    font-size: 1.05rem;
}

/* Grade information styling - simplified without background boxes */

/* ===================================================================
   8. SEARCH FUNCTIONALITY
   ================================================================ */
.search-container {
    margin-bottom: 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 20px 25px;
    font-size: 1.2rem;
    border: none;
    border-radius: 25px;
    background: #121213;
    color: #c3d6ec;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
    position: relative;
    z-index: 10;
}

.search-input:focus {
    outline: none;
    background: #121213;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.subject-list {
    list-style: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    position: relative;
    height: 70vh;
    min-height: 70vh;
    overflow-y: auto;
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.subject-list::-webkit-scrollbar {
    width: 8px;
}

.subject-list::-webkit-scrollbar-track {
    background: transparent;
}

.subject-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.subject-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.subject-list li {
    background: #121213;
    backdrop-filter: blur(15px);
    margin: 8px 8px;
    padding: 18px 25px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 1.05rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(0);
    opacity: 1;
    position: relative;
}

.subject-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.subject-list li:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    background: #121213;
    border-color: rgba(102, 126, 234, 0.3);
}

.subject-list li:hover::before {
    opacity: 1;
}

/* ===================================================================
   9. UTILITY CLASSES
   ================================================================ */
.no-data {
    text-align: center;
    font-size: 1.2rem;
    color: #7f8c8d;
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
}

/* ===================================================================
   10. ANIMATIONS & KEYFRAMES
   ================================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Animation Delays */
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }
.card:nth-child(6) { animation-delay: 0.5s; }

/* ===================================================================
   11. RESPONSIVE DESIGN
   ================================================================ */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .page-wrapper {
        min-height: calc(100vh - 30px);
    }
    
    .page-title-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .page-title-grid > div:first-child,
    .page-title-grid > p:first-child {
        display: none;
    }
    
    .page-title-grid > div:last-child {
        justify-content: center !important;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        min-height: 280px;
    }
    
    .info-section-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        min-height: 180px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .container {
        padding: 15px;
    }
    
    .page-wrapper {
        margin: 15px;
        min-height: calc(100vh - 30px);
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.2rem;
        min-height: 250px;
    }
    
    .info-section-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.2rem;
        min-height: 160px;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    .page-wrapper {
        margin: 8px;
        padding: 24px;
        min-height: calc(100vh - 16px);
        border-radius: 25px;
    }
    
    .container {
        padding: 12px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: 200px;
    }
    
    .card {
        padding: 2.2rem;
        border-radius: 25px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
        border: 2px solid rgba(102, 126, 234, 0.15);
        background: linear-gradient(145deg, #121212, #1a1a1a);
    }
    
    .card-title {
        font-size: 1.7rem;
        margin-bottom: 1.5rem;
        color: #e8f4fd;
        font-weight: 700;
    }
    
    .card-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .card-left p {
        font-size: 1.1rem;
        margin: 1rem 0;
        line-height: 1.8;
        color: #d1e7dd;
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .card-left p:last-child {
        border-bottom: none;
    }
    
    .card-left strong {
        color: #667eea;
        font-weight: 600;
        display: inline-block;
        min-width: 110px;
        font-size: 1.05rem;
    }
    
    .card-right {
        text-align: left;
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-top: 1.5rem;
        padding: 1.5rem;
        border-radius: 15px;
        border-left: 4px solid #667eea;
    }
    
    .card-right p {
        font-size: 1.1rem;
        font-weight: 600;
        color: #d1e7dd;
        margin: 0.6rem 0;
        padding: 0.4rem 0;
        border-radius: 10px;
        font-family: 'Consolas', 'Monaco', monospace;
    }
    
    .info-section-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: 150px;
    }
    
    .info-section {
        padding: 2.5rem;
        border-radius: 25px;
        border-left-width: 8px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
    }
    
    .info-section h1 {
        font-size: 1.6rem;
        margin-bottom: 2rem;
        color: #e8f4fd;
    }
    
    .info-section p {
        font-size: 1.1rem;
        margin: 1.2rem 0;
        line-height: 1.8;
        padding: 1rem;
    }
    
    .info-section p strong {
        min-width: 120px;
        font-size: 1.05rem;
    }
    
    .page-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin: 2.5rem 0 1.5rem 0;
        text-align: center;
        background: linear-gradient(135deg, #667eea, #764ba2);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .btn-back {
        width: 160px;
        height: 52px;
        font-size: 1.05rem;
        border-radius: 18px;
        border-width: 3px;
    }
    
    .search-input {
        padding: 20px 24px;
        font-size: 1.15rem;
        border-radius: 30px;
        box-shadow: 0 15px 45px rgba(102, 126, 234, 0.2);
    }
    
    .subject-list {
        height: 60vh;
        min-height: 60vh;
    }
    
    .subject-list li {
        padding: 18px 24px;
        font-size: 1.05rem;
        margin: 10px 6px;
        border-radius: 25px;
        font-weight: 600;
    }
    
    .subject-list li:hover {
        transform: translateY(-3px) scale(1.02);
    }
}

/* Small phones */
@media (max-width: 480px) {
    .page-wrapper {
        margin: 6px;
        padding: 18px;
        min-height: calc(100vh - 12px);
        border-radius: 22px;
    }
    
    .container {
        padding: 8px;
    }
    
    .page-title {
        font-size: 1.9rem;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin: 2rem 0 1.2rem 0;
    }
    
    .card {
        padding: 2rem;
        border-radius: 22px;
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
        border: 2px solid rgba(102, 126, 234, 0.12);
        background: linear-gradient(145deg, #121212, #1a1a1a);
    }
    
    .card-title {
        font-size: 1.5rem;
        margin-bottom: 1.3rem;
        font-weight: 700;
        color: #e8f4fd;
    }
    
    .card-left p {
        font-size: 1rem;
        margin: 0.8rem 0;
        padding: 0.6rem 0;
        line-height: 1.7;
        color: #d1e7dd;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .card-left p:last-child {
        border-bottom: none;
    }
    
    .card-left strong {
        min-width: 90px;
        font-size: 0.95rem;
        color: #667eea;
        font-weight: 600;
    }
    
    .card-right {
        padding: 1.2rem;
        margin-top: 1.2rem;
        border-radius: 12px;
        border-left: 4px solid #667eea;
    }
    
    .card-right p {
        font-size: 0.95rem;
        margin: 0.5rem 0;
        padding: 0.3rem 0;
        border-radius: 8px;
        font-family: 'Consolas', 'Monaco', monospace;
        font-weight: 600;
        color: #d1e7dd;
    }
    
    .card-grid {
        min-height: 150px;
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .info-section {
        padding: 2rem;
        border-radius: 20px;
        border-left-width: 6px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    }
    
    .info-section-grid {
        min-height: 120px;
        gap: 1.2rem;
    }
    
    .info-section h1 {
        font-size: 1.4rem;
        margin-bottom: 1.8rem;
    }
    
    .info-section p {
        font-size: 1rem;
        margin: 1rem 0;
        padding: 0.8rem;
        line-height: 1.7;
    }
    
    .btn-back {
        width: 140px;
        height: 44px;
        font-size: 0.95rem;
        border-radius: 15px;
    }
    
    .search-input {
        padding: 16px 20px;
        font-size: 1.05rem;
        border-radius: 25px;
    }
    
    .subject-list li {
        padding: 14px 18px;
        font-size: 0.95rem;
        margin: 8px 4px;
        border-radius: 20px;
    }
    
    .page-title-grid {
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
}
