/* ========================================
   MOBILE RESPONSIVE STYLES - SCCE Web App
   ======================================== */

/* Global Styles - Mobile First */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: #0a0a0a;
    position: relative;
    overflow-x: hidden;
}

a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #9d4edd;
}

/* ========== UTILITIES & SPACING ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Margin Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 2.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding Utilities */
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Display Utilities */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ========== SIDEBAR & NAVIGATION ========== */
.sidebar {
    width: 260px;
    background: #1a1a1a;
    border-right: 1px solid #2e2e2e;
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1000;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #2e2e2e;
}

.sidebar-header h2 {
    font-size: 18px;
    color: #e0e0e0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: #999;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #2a2a2a;
    color: #1cffa0;
    border-left-color: #1cffa0;
}

.sidebar-nav .nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #2e2e2e;
    margin-top: auto;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #ff4757;
    font-size: 14px;
}


.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #0a0a0a;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Mobile Overlay - For sidebar backdrop */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* ========== MAIN CONTENT AREA ========== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 0;
}

header {
    background: #1a1a1a;
    border-bottom: 1px solid #2e2e2e;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

header h1 {
    font-size: 22px;
    color: #e0e0e0;
    margin: 0;
    word-wrap: break-word;
}

.header-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-btn {
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    color: #e0e0e0;
    cursor: pointer;
    border-radius: 5px;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #333;
    color: #1cffa0;
}

/* ========== FORMS & INPUTS ========== */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.form-group label {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1cffa0;
    box-shadow: 0 0 0 2px rgba(28, 255, 160, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* ========== BUTTONS ========== */
button, .btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    display: inline-block;
    min-height: 44px;
}

button:active, .btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #32d994;
    color: #0a0a0a;
}

.btn-primary:hover {
    background: #1cffa0;
}

.btn-secondary {
    background: #666;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: #ff4757;
    color: #ffffff;
}

.btn-danger:hover {
    background: #ff3838;
}

/* ========== TABLES - RESPONSIVE ========== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 5px;
    border: 1px solid #2e2e2e;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    font-size: 14px;
}

thead {
    background: #2a2a2a;
    position: sticky;
    top: 0;
}

th {
    padding: 12px;
    text-align: left;
    color: #e0e0e0;
    font-weight: 600;
    border-bottom: 1px solid #333;
}

td {
    padding: 12px;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

tr:hover {
    background: #2a2a2a;
}

/* ========== CARDS & GRIDS ========== */
.card {
    background: #1a1a1a;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #1cffa0;
    box-shadow: 0 0 10px rgba(28, 255, 160, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1a1a1a;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    color: #999;
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    color: #1cffa0;
    font-size: 28px;
    font-weight: 700;
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

/* ========== SCROLLBAR STYLING ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9d4edd;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Small mobile: 320px - 480px */
@media (max-width: 480px) {
    html { font-size: 14px; }
    
    .container { padding: 0 12px; }
    
    header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    header h1 {
        font-size: 18px;
    }
    
    .header-controls {
        width: 100%;
        gap: 8px;
    }

    .toggle-btn {
        flex: 1;
        min-width: 45px;
    }

    .toggle-btn span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 22px;
    }

    table { font-size: 12px; }
    
    th, td {
        padding: 8px 6px;
    }

    button, .btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 14px;
    }

    .card {
        padding: 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 14px;
    }
}

/* Tablet: 481px - 768px */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .main-wrapper {
        margin-left: 0;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .container {
        padding: 0 15px;
    }

    header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-left: 60px;
    }

    header h1 {
        font-size: 20px;
    }

    .header-controls {
        align-self: flex-end;
        gap: 8px;
    }

    .toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .toggle-btn span {
        display: inline;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

    .tabs {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-button {
        flex: 1;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .search-box input {
        max-width: 100%;
    }
}

/* Desktop: 769px - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        width: 240px;
    }

    .main-wrapper {
        margin-left: 240px;
    }

    .menu-toggle {
        display: none;
    }

    header .container {
        padding-left: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Desktop: 1025px+ */
@media (min-width: 1025px) {
    .sidebar {
        position: fixed;
        left: 0;
        width: 260px;
        z-index: 10;
    }

    .main-wrapper {
        margin-left: 260px;
    }

    .menu-toggle,
    .mobile-overlay {
        display: none !important;
    }

    header .container {
        padding-left: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    button, .btn {
        min-width: auto;
    }
}

/* ========== UTILITY CLASSES ========== */
.d-none { display: none; }

.d-sm-none { display: none; }
@media (min-width: 481px) {
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
}

.d-md-none { display: block; }
@media (min-width: 769px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
}

.d-lg-none { display: block; }
@media (min-width: 1025px) {
    .d-lg-none { display: none; }
    .d-lg-block { display: block; }
}
