/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #b31b1b;
    --primary-dark: #8b0000;
    --black: #1a1a1a;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray: #666666;
    --gold: #c6a43f;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--black);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-dark));
    color: var(--white);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--white);
    line-height: 1.2;
}

.logo span {
    color: var(--gold);
    font-size: 0.8rem;
    display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 0;
}

.nav-menu a:hover {
    color: var(--gold);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('uploads/japan-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    padding: 0 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-red);
}

.btn-success { background: var(--success); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Features Section */
.features {
    padding: 60px 0;
    background: var(--gray-light);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 0.8rem;
}

.section-title p {
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto;
    padding: 0 15px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.feature-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8rem;
}

/* Stats Section */
.stats {
    background: var(--primary-red);
    color: var(--white);
    padding: 50px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-item h3 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

/* Testimonials */
.testimonials {
    padding: 60px 0;
    background: var(--white);
}

.testimonial-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.testimonial-card {
    background: var(--gray-light);
    padding: 25px;
    border-radius: 12px;
    position: relative;
}

.testimonial-card::before {
    content: '"';
    font-size: 3.5rem;
    color: var(--primary-red);
    opacity: 0.3;
    position: absolute;
    top: 5px;
    left: 15px;
}

.testimonial-content {
    margin-bottom: 15px;
    font-style: italic;
    font-size: 0.95rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

/* Footer */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--gray-light);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--gold);
}

.contact-info {
    list-style: none;
}

.contact-info li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.whatsapp-btn {
    background: #25D366;
    color: var(--white);
    padding: 10px 18px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-top: 10px;
    font-size: 0.95rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #888;
    font-size: 0.9rem;
}

/* Login/Register Forms */
.auth-container {
    max-width: 400px;
    margin: 30px auto;
    padding: 25px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.auth-title {
    text-align: center;
    color: var(--primary-red);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(179, 27, 27, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Admin Sidebar */
.admin-sidebar {
    background: var(--black);
    color: white;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: #333;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 3px;
}

.admin-sidebar h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    padding: 0 15px;
    font-size: 1.2rem;
}

.admin-menu {
    list-style: none;
    padding: 0;
}

.admin-menu li {
    margin-bottom: 5px;
}

.admin-menu a {
    color: #ccc;
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.admin-menu a:hover {
    background: #333;
    color: white;
    border-left-color: var(--primary-red);
}

.admin-menu a i {
    width: 20px;
    font-size: 1.1rem;
}

.admin-menu a.active,
.admin-menu a[style*="background: #b31b1b"] {
    background: var(--primary-red);
    color: white;
    border-left-color: var(--gold);
}

.menu-badge {
    background: var(--warning);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-left: auto;
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
    background: var(--primary-red);
    color: white;
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    align-items: center;
    gap: 10px;
}

.admin-main {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow-x: auto;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    background: var(--primary-red);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-active { background: var(--success); color: white; }
.status-inactive { background: #999; color: white; }
.status-probation { background: var(--warning); color: white; }
.status-graduated { background: var(--info); color: white; }

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

/* Action Buttons */
.action-btn-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    color: white;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.btn-view { background: var(--info); }
.btn-edit { background: var(--warning); }
.btn-delete { background: var(--danger); }
.btn-fees { background: var(--success); }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 30px auto;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-red);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    color: var(--primary-red);
    font-size: 1.5rem;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger);
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 2;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    border: 2px solid var(--primary-red);
    border-radius: 25px;
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--primary-red);
    color: white;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 992px) {
    .admin-main {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    /* Header */
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary-red), var(--primary-dark));
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    /* Hero */
    .hero {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Admin Sidebar */
    .admin-sidebar {
        transform: translateX(-100%);
        width: 85%;
        max-width: 300px;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-sidebar-toggle {
        display: flex;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 15px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .stat-info h3 {
        font-size: 1.2rem;
    }
    
    .stat-info p {
        font-size: 0.8rem;
    }
    
    /* Filter Section */
    .filter-section {
        flex-direction: column;
        padding: 15px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filter-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .filter-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* Tables */
    .table-container {
        padding: 10px;
    }
    
    table {
        min-width: 100%;
    }
    
    /* Card-style tables for mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead {
        display: none;
    }
    
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 10px;
        background: white;
    }
    
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #eee;
        text-align: right;
    }
    
    td:last-child {
        border-bottom: none;
    }
    
    td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-red);
        margin-right: 10px;
        text-align: left;
    }
    
    /* Action buttons */
    .action-btn-group {
        justify-content: flex-end;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    /* Modal */
    .modal-content {
        margin: 20px auto;
        padding: 20px;
        width: 95%;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    /* Form */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        margin: 20px auto;
        padding: 20px;
        width: 90%;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links,
    .contact-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .contact-info li {
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .student-tabs {
        flex-wrap: wrap;
    }
    
    .student-tab {
        flex: 1 1 auto;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .show-mobile { display: block; }
}