/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #4158D0;
    --secondary-color: #C850C0;
    --accent-color: #FFCC70;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #20c997;
    --danger-color: #ff6b6b;
    --warning-color: #ffd166;
    --info-color: #4dabf7;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body {
    background-color: #f0f2f5;
    color: #333;
    padding-bottom: 70px; /* Space for navbar */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    border-radius: 20px;
}

/* Header Styles */
.app-header {
    background: var(--gradient-primary);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 10px 20px rgba(65, 88, 208, 0.2);
}

.back-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.app-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 22px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Profile Section */
.profile-section {
    padding: 30px 20px;
    text-align: center;
    position: relative;
    margin-top: -50px;
    z-index: 10;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    background: linear-gradient(145deg, #e6e9ef, #ffffff);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 5px 25px rgba(65, 88, 208, 0.3);
    }
    100% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.profile-pic img:hover {
    transform: scale(1.1);
}

.profile-pic .initials {
    font-size: 48px;
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.student-name {
    font-size: 24px;
    font-weight: 700;
    margin-top: 20px;
    color: var(--dark-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-details {
    color: #666;
    font-size: 15px;
    margin-top: 8px;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 13px;
    margin-top: 15px;
    font-weight: 600;
    color: white;
    background: var(--success-color);
    box-shadow: 0 3px 10px rgba(32, 201, 151, 0.3);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(32, 201, 151, 0.4);
}

/* Quick Stats */
.quick-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    margin: 15px 15px 20px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item {
    text-align: center;
    padding: 12px;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.stat-item:hover {
    background: rgba(65, 88, 208, 0.05);
    transform: translateY(-5px);
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs */
.tab-navigation {
    display: flex;
    justify-content: space-around;
    margin: 15px 10px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 5px;
    position: relative;
    overflow: hidden;
}

.tab-indicator {
    position: absolute;
    height: 3px;
    background: var(--gradient-primary);
    bottom: 0;
    left: 0;
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 25%; /* Will be controlled by JS */
    border-radius: 3px;
}

.tab-link {
    padding: 12px 5px;
    font-size: 14px;
    color: #777;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    width: 25%;
    text-align: center;
    z-index: 2;
    font-weight: 500;
}

.tab-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.5s ease forwards;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info Cards */
.info-card {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(20px);
}

.info-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.card-icon {
    color: #fff;
    font-size: 18px;
    margin-right: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    box-shadow: 0 3px 8px rgba(65, 88, 208, 0.3);
}

.card-body {
    padding: 20px;
}

.info-item {
    display: flex;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
}

.info-item:hover {
    background: #f8f9fa;
}

.info-label {
    width: 40%;
    color: #777;
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    width: 60%;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 14px;
}

/* Fee Table */
.fee-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.fee-table th, .fee-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.fee-table th {
    background: #f8f9fa;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.fee-table tr:last-child td {
    border-bottom: none;
}

.fee-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.fee-table tr {
    transition: all 0.3s ease;
}

.fee-table tr:hover {
    background-color: #f0f2f5;
}

.fee-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 12px;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-paid {
    background: linear-gradient(135deg, #20c997, #38d39f);
    box-shadow: 0 3px 8px rgba(32, 201, 151, 0.3);
}

.status-unpaid {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
}

/* Chart Containers */
.chart-container {
    margin-top: 20px;
    height: 250px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    padding: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

/* Bottom Navbar */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
}

.nav-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 0;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.nav-item:hover .nav-icon,
.nav-item:hover .nav-label {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 22px;
    color: #777;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.nav-label {
    font-size: 12px;
    color: #777;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item.active .nav-icon,
.nav-item.active .nav-label {
    color: var(--primary-color);
}

.nav-item.active::before {
    width: 30px;
}

.nav-item.active {
    transform: translateY(-3px);
}

/* Timeline */
.timeline {
    position: relative;
    margin: 20px 0;
    padding-left: 30px;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease;
}

.timeline-item.animate {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    box-shadow: 0 3px 8px rgba(65, 88, 208, 0.3);
    z-index: 2;
}

.timeline-content {
    padding: 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.timeline-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.timeline-date i {
    margin-right: 5px;
    color: var(--primary-color);
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.timeline-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 30px;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 30px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Attendance Donut Chart */
.attendance-chart {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.attendance-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeIn 1s ease;
}

.attendance-label {
    position: absolute;
    top: calc(50% + 20px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(65, 88, 208, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    margin-bottom: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Animations */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-scale {
    animation: scale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(65, 88, 208, 0.3);
    text-align: center;
    text-decoration: none;
    margin-top: 15px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(65, 88, 208, 0.4);
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .profile-section {
        padding: 20px 15px;
    }
    
    .tab-link {
        font-size: 12px;
        padding: 10px 5px;
    }
    
    .info-label, .info-value {
        font-size: 13px;
    }
    
    .profile-pic {
        width: 100px;
        height: 100px;
    }
}