/*================================================
            SMART STUDY SOLUTIONS
        Responsive Stylesheet for All Devices
================================================*/

/*========== LARGE DEVICES (Desktops, 1200px and up) ==========*/
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .stat-card .stat-value {
        font-size: 28px;
    }
}

/*========== MEDIUM DEVICES (Laptops, 992px to 1199px) ==========*/
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .service-card .service-name {
        font-size: 16px;
    }
    
    .wallet-balance {
        font-size: 36px;
    }
}

/*========== SMALL DEVICES (Tablets, 768px to 991px) ==========*/
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Sidebar */
    .sidebar {
        width: 200px;
    }
    
    .sidebar a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .sidebar a i {
        margin-right: 8px;
        width: 18px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 20px;
    }
    
    /* Typography */
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 22px; }
    h4 { font-size: 20px; }
    
    /* Stats Cards */
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    /* Wallet */
    .wallet-balance {
        font-size: 32px;
    }
    
    /* Tables */
    .table th, .table td {
        padding: 8px;
        font-size: 14px;
    }
    
    /* Cards Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .contact-options {
        gap: 20px;
    }
    
    .contact-option {
        width: 220px;
        padding: 20px;
    }
}

/*========== EXTRA SMALL DEVICES (Mobile Phones, 576px to 767px) ==========*/
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    /* Layout */
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }
    
    .sidebar .p-4 {
        padding: 15px !important;
    }
    
    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar a {
        width: calc(50% - 10px);
        margin: 5px;
        padding: 10px;
        font-size: 13px;
        text-align: center;
    }
    
    .sidebar a i {
        margin-right: 5px;
        width: auto;
        display: block;
        margin-bottom: 5px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    /* Typography */
    h1 { font-size: 24px; }
    h2 { font-size: 22px; }
    h3 { font-size: 20px; }
    h4 { font-size: 18px; }
    h5 { font-size: 16px; }
    h6 { font-size: 14px; }
    
    /* Header */
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-bottom: 10px;
        justify-content: center;
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .nav-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .login-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .contact-info {
        text-align: center;
    }
    
    /* Hero Section */
    .hero {
        padding: 50px 0;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .cta-button, .cta-button-outline {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    /* Stats Cards */
    .row {
        margin-right: -10px;
        margin-left: -10px;
    }
    
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-md-12 {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    .stat-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .stat-card .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Wallet */
    .wallet-card {
        padding: 20px;
    }
    
    .wallet-balance {
        font-size: 28px;
    }
    
    .wallet-actions {
        display: flex;
        gap: 10px;
    }
    
    .action-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    /* Tables */
    .table-container {
        padding: 15px;
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th, .table td {
        padding: 8px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Cards Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .service-card .service-header {
        padding: 15px;
    }
    
    .service-card .service-header h3 {
        font-size: 1.2rem;
    }
    
    .service-card .service-body {
        padding: 15px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* Contact Section */
    .contact-options {
        gap: 15px;
    }
    
    .contact-option {
        width: 100%;
        max-width: 280px;
        padding: 20px;
    }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    /* Modal */
    .modal-dialog {
        width: 95%;
        margin: 10px auto;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    /* Tree View */
    .tree-container {
        padding: 20px;
    }
    
    .tree-node-content {
        min-width: 150px;
        padding: 15px;
    }
    
    .tree-node-content .member-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .tree-node-content .member-name {
        font-size: 13px;
    }
    
    /* Chart Container */
    .chart-container {
        padding: 15px;
    }
    
    canvas {
        max-height: 250px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Floating Action Button */
    .floating-login {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-login a {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .floating-login span {
        display: none;
    }
}

/*========== EXTRA EXTRA SMALL DEVICES (Small Mobile Phones, below 576px) ==========*/
@media (max-width: 575px) {
    .container {
        width: 100%;
        padding: 0 12px;
    }
    
    /* Layout */
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }
    
    .sidebar .p-4 {
        padding: 12px !important;
    }
    
    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
    }
    
    .sidebar a {
        width: 100%;
        margin: 3px 0;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .sidebar a i {
        width: 20px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 12px;
    }
    
    /* Typography */
    h1 { font-size: 22px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 15px; }
    h6 { font-size: 14px; }
    
    body {
        font-size: 14px;
    }
    
    /* Header */
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text span {
        font-size: 0.8rem;
    }
    
    .nav-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .login-btn {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        justify-content: center;
    }
    
    .contact-info a {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    /* Hero Section */
    .hero {
        padding: 40px 0;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .cta-button, .cta-button-outline {
        width: 100%;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Section Titles */
    .section-title {
        margin-bottom: 30px;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .section-title p {
        font-size: 0.9rem;
    }
    
    /* Stats Cards */
    .row {
        margin-right: -8px;
        margin-left: -8px;
    }
    
    .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-md-12 {
        padding-right: 8px;
        padding-left: 8px;
    }
    
    .stat-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .stat-card .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin-right: 0 !important;
        margin-bottom: 8px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    /* Wallet Card */
    .wallet-card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .wallet-label {
        font-size: 14px;
    }
    
    .wallet-balance {
        font-size: 24px;
    }
    
    .wallet-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 13px;
        text-align: center;
    }
    
    /* Tables */
    .table-container {
        padding: 12px;
        overflow-x: auto;
    }
    
    .table {
        min-width: 500px;
    }
    
    .table th, .table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .table-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    /* Cards */
    .service-card, .product-card, .member-card {
        margin-bottom: 15px;
    }
    
    .service-card .service-header {
        padding: 12px;
    }
    
    .service-card .service-header h3 {
        font-size: 1.1rem;
    }
    
    .service-card .service-body {
        padding: 12px;
    }
    
    .service-card .service-body li {
        font-size: 13px;
        padding: 6px 0;
    }
    
    .service-price {
        font-size: 22px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .form-control-lg {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Bank Details */
    .bank-details {
        padding: 15px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-label {
        width: 100%;
        font-size: 13px;
    }
    
    .detail-value {
        width: 100%;
        font-size: 13px;
    }
    
    .copy-btn {
        margin-left: 0;
        margin-top: 5px;
    }
    
    /* Contact Section */
    .contact-options {
        gap: 12px;
    }
    
    .contact-option {
        width: 100%;
        max-width: 250px;
        padding: 15px;
    }
    
    .contact-option i {
        font-size: 2rem;
    }
    
    .contact-option h3 {
        font-size: 16px;
    }
    
    .contact-option p {
        font-size: 13px;
    }
    
    /* Footer */
    footer {
        padding: 30px 0 15px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .footer-section ul li {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .copyright {
        font-size: 11px;
        padding-top: 15px;
    }
    
    /* Quick Actions */
    .quick-actions {
        padding: 15px;
    }
    
    .quick-actions .row {
        flex-direction: column;
    }
    
    .action-btn {
        padding: 12px;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .action-btn h6 {
        font-size: 13px;
        margin: 5px 0 3px;
    }
    
    .action-btn small {
        font-size: 11px;
    }
    
    /* Tree View */
    .tree-container {
        padding: 15px;
    }
    
    .tree-node-content {
        min-width: 120px;
        padding: 10px;
    }
    
    .tree-node-content .member-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .tree-node-content .member-name {
        font-size: 11px;
    }
    
    .tree-node-content .member-level {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .tree-children {
        gap: 10px;
    }
    
    /* Charts */
    .chart-container {
        padding: 12px;
    }
    
    canvas {
        max-height: 200px;
    }
    
    /* Modals */
    .modal-dialog {
        width: 95%;
        margin: 10px auto;
    }
    
    .modal-content {
        padding: 12px;
    }
    
    .modal-header {
        padding: 12px;
    }
    
    .modal-header h5 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .modal-footer {
        padding: 12px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .page-link {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px;
        font-size: 13px;
    }
    
    .alert i {
        font-size: 16px;
    }
    
    /* Badges */
    .badge, .kyc-badge {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    /* Tooltips */
    .tooltip .tooltip-text {
        display: none;
    }
    
    /* Floating Button */
    .floating-login {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-login a {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Loading Spinner */
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    
    /* Scrollbar for Mobile */
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 2px;
    }
}

/*========== LANDSCAPE MODE (Mobile Landscape) ==========*/
@media (max-width: 767px) and (orientation: landscape) {
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar a {
        width: auto;
        min-width: 150px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .wallet-actions {
        flex-direction: row;
    }
    
    .action-btn {
        width: auto;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*========== PRINT STYLES ==========*/
@media print {
    .sidebar,
    .wallet-actions,
    .btn,
    .action-btn,
    .quick-actions,
    .floating-login,
    .footer,
    header,
    .hero-buttons,
    .contact-options {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .stat-card,
    .table-container,
    .wallet-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    table th,
    table td {
        border: 1px solid #ddd;
        padding: 8px;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: black;
        page-break-after: avoid;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/*========== HIGH RESOLUTION DISPLAYS ==========*/
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .sidebar {
        width: 300px;
    }
    
    .main-content {
        margin-left: 300px;
    }
    
    .stat-card .stat-value {
        font-size: 32px;
    }
    
    .wallet-balance {
        font-size: 48px;
    }
}

/*========== DARK MODE SUPPORT ==========*/
@media (prefers-color-scheme: dark) {
    body.dark-mode-support {
        background: #1a1a1a;
        color: #f0f0f0;
    }
    
    body.dark-mode-support .card,
    body.dark-mode-support .stat-card,
    body.dark-mode-support .table-container,
    body.dark-mode-support .form-control {
        background: #2d2d2d;
        color: #f0f0f0;
        border-color: #404040;
    }
    
    body.dark-mode-support .table th,
    body.dark-mode-support .table td {
        border-color: #404040;
    }
    
    body.dark-mode-support .table tbody tr:hover {
        background: #363636;
    }
    
    body.dark-mode-support .text-muted {
        color: #aaa !important;
    }
}

/*========== ACCESSIBILITY ==========*/
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/*========== CUSTOM SCROLLBAR ==========*/
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--gray-200);
}