﻿/* Mobile-first responsive design */
* {
    box-sizing: border-box;
}

/* Move down content because we have a fixed navbar that is 50px tall */
body {
    padding-top: 50px;
    padding-bottom: 20px;
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first body content */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Mobile-optimized form inputs */
input,
select,
textarea {
    max-width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

/* Mobile-responsive tables */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
        vertical-align: middle;
    }
    
    /* Stack table cells on very small screens */
    @media (max-width: 480px) {
        .table,
        .table thead,
        .table tbody,
        .table th,
        .table td,
        .table tr {
            display: block;
        }
        
        .table thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }
        
        .table tr {
            border: 1px solid #ccc;
            margin-bottom: 10px;
            padding: 10px;
            border-radius: 8px;
            background: white;
        }
        
        .table td {
            border: none;
            position: relative;
            padding-left: 50% !important;
            padding-top: 8px;
            padding-bottom: 8px;
        }
        
        .table td:before {
            content: attr(data-label) ": ";
            position: absolute;
            left: 6px;
            width: 45%;
            text-align: left;
            font-weight: bold;
        }
    }
}

/* Dashboard specific styles */
.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.metric-card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.table {
    margin-bottom: 0;
}

.btn-sm {
    margin-right: 5px;
}

.nav-tabs .nav-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
    .jumbotron {
        margin-top: 20px;
    }

    .body-content {
        padding: 0;
    }
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .metric-card {
        margin-bottom: 15px;
    }
    
    .dashboard-header h2 {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}
