/* ============================================
   BTS APP - Comprehensive Responsive Stylesheet
   Minimal Animations, Maximum Performance
   ============================================ */

/* CSS Variables - Consistent Color Scheme */
:root {
    /* Primary Colors - Consistent across all pages */
    --primary: #667eea;
    --primary-dark: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Secondary Colors */
    --secondary: #764ba2;
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* Status Colors */
    --success: #28a745;
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning: #ffc107;
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --danger: #dc3545;
    --danger-gradient: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    --info: #17a2b8;
    --info-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Neutral Colors */
    --dark: #212529;
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%);
    --light: #f8f9fa;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    
    /* Shadows */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    /* Border & Radius */
    --border-radius: 12px;
    --border-color: #ced4da;
    
    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.2s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Container & Layout */
.container, .container-fluid {
    padding: 15px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

/* Page Headers - Consistent across all pages */
header, .header, .page-header, .bg-gradient-primary {
    background: var(--primary-gradient);
    color: white;
    padding: 25px 30px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

header h1, header h2, .header h1, .header h2, .page-header h1, .page-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

header p, .header p, .page-header p {
    font-size: 1rem;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

/* Dashboard Container */
.dashboard {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 25px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: var(--shadow-medium);
    position: relative;
    z-index: 1;
}

.dashboard-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
    text-align: left;
}

.dashboard-header h2 {
    font-size: 1.9rem;
    margin-bottom: 12px;
    color: #212529;
    font-weight: 800;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-header h2 i {
    color: var(--primary);
    font-size: 1.8rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 800;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.2;
}

.dashboard-subtitle {
    font-size: 1rem;
    color: #495057;
    font-weight: 500;
    margin-bottom: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    background: white;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-medium);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
}

.card-body {
    padding: 20px;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white !important;
}

.btn-primary:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-success {
    background: var(--success-gradient);
    color: white !important;
}

.btn-success:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-danger {
    background: var(--danger-gradient);
    color: white !important;
}

.btn-danger:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-warning {
    background: var(--warning-gradient);
    color: #212529 !important;
}

.btn-warning:hover {
    opacity: 0.9;
    color: #212529 !important;
}

.btn-info {
    background: var(--info-gradient);
    color: white !important;
}

.btn-info:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white !important;
}

.btn-secondary:hover {
    opacity: 0.9;
    color: white !important;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.btn-light {
    background: rgba(255, 255, 255, 0.9);
    color: #212529 !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-light:hover {
    background: white !important;
    color: #212529 !important;
}

/* Forms */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 14px;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    background: #fff;
    width: 100%;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    display: block;
    font-size: 0.9rem;
}

.form-floating {
    margin-bottom: 20px;
}

.form-floating .form-control {
    padding: 1rem 0.75rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Dashboard Tiles */
.tile {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-decoration: none;
    color: #333;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.5);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.tile:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.tile .title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.tile .text {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-weight: 400;
}

.tile .icon {
    font-size: 2.5rem;
    align-self: flex-end;
    opacity: 0.7;
}

.tile.green::before { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.tile.blue::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.tile.lightblue::before { background: linear-gradient(90deg, #fa709a, #fee140); }
.tile.brown::before { background: linear-gradient(90deg, #43e97b, #38f9d7); }
.tile.orange::before { background: linear-gradient(90deg, #f093fb, #f5576c); }
.tile.darkbrown::before { background: linear-gradient(90deg, #2c3e50, #4a6741); }
.tile.littlegreen::before { background: linear-gradient(90deg, #4facfe, #00f2fe); }

/* Dashboard Header */
.dashboard-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-medium);
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.01em;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
}

.brand-section {
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 30px 20px;
}

.brand-logo {
    max-width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.3));
    margin-bottom: 25px;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 12px;
}

.brand-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.form-section {
    padding: 40px 30px;
    background: #fff;
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
    color: #667eea;
    border-radius: 12px 0 0 12px;
}

.form-floating .input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px 25px;
    box-shadow: var(--shadow-light);
    color: white;
    width: 100%;
}

.floating-badge {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 16px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
}

.powered-by {
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.powered-by small {
    color: #6c757d;
    font-weight: 500;
}

.powered-by a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* ============================================
   RESPONSIVE MEDIA QUERIES
   ============================================ */

/* Mobile First - Base styles for mobile (up to 575px) */
@media (max-width: 575.98px) {
    body {
        padding: 10px;
    }
    
    .container, .container-fluid {
        padding: 10px;
    }
    
    .dashboard-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.95rem;
    }
    
    .tile {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .tile .icon {
        font-size: 1.8rem;
    }
    
    .tile .title {
        font-size: 0.9rem;
    }
    
    .tile .text {
        font-size: 0.85rem;
    }
    
    .btn {
        min-height: 44px;
        padding: 10px 15px;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .form-section {
        padding: 25px 18px;
    }
    
    .form-title {
        font-size: 1.4rem;
    }
    
    .brand-title {
        font-size: 1.4rem;
    }
    
    .brand-logo {
        max-height: 120px;
    }
    
    .floating-badge {
        top: 8px;
        left: 8px;
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .login-card {
        margin: 5px;
        border-radius: 15px;
    }
    
    .brand-section {
        min-height: 280px;
    }
    
    /* Page headers responsive */
    header, .header, .page-header {
        padding: 20px 15px;
    }
    
    header h1, header h2, .header h1, .header h2 {
        font-size: 1.4rem;
    }
    
    .content {
        padding: 15px;
    }
    
    .dashboard {
        padding: 15px;
    }
    
    .dashboard-header h2 {
        font-size: 1.5rem;
    }
}

/* Small Mobile Landscape / Small Tablets (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .dashboard-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .dashboard-title {
        font-size: 1.8rem;
    }
    
    .tile {
        padding: 1.5rem;
    }
    
    .btn {
        min-height: 44px;
        padding: 10px 20px;
    }
    
    .form-section {
        padding: 35px 25px;
    }
    
    .form-title {
        font-size: 1.6rem;
    }
    
    .brand-title {
        font-size: 1.6rem;
    }
    
    .brand-logo {
        max-height: 180px;
    }
    
    .login-card {
        margin: 10px;
        max-width: 550px;
    }
    
    header, .header, .page-header {
        padding: 22px 20px;
    }
    
    header h1, header h2, .header h1, .header h2 {
        font-size: 1.6rem;
    }
    
    .content {
        padding: 20px;
    }
    
    .dashboard {
        padding: 20px;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .dashboard-header {
        padding: 2rem 1.5rem;
    }
    
    .dashboard-title {
        font-size: 2rem;
    }
    
    .tile {
        padding: 1.75rem;
    }
    
    .card-body {
        padding: 18px;
    }
    
    .form-section {
        padding: 40px 30px;
    }
    
    header, .header, .page-header {
        padding: 25px 25px;
    }
    
    header h1, header h2, .header h1, .header h2 {
        font-size: 1.75rem;
    }
    
    .content {
        padding: 22px;
    }
    
    .dashboard {
        padding: 22px;
    }
}

/* Tablet Landscape / Small Laptop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .dashboard-title {
        font-size: 2.2rem;
    }
    
    .tile {
        padding: 1.9rem;
    }
    
    header, .header, .page-header {
        padding: 25px 28px;
    }
    
    .content {
        padding: 25px;
    }
    
    .dashboard {
        padding: 25px;
    }
}

/* Desktop / Large Laptop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .container {
        max-width: 1200px;
    }
    
    header, .header, .page-header {
        padding: 25px 30px;
    }
    
    .content {
        padding: 25px;
    }
    
    .dashboard {
        padding: 25px;
    }
}

/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    header, .header, .page-header {
        padding: 25px 30px;
    }
    
    .content {
        padding: 25px;
    }
    
    .dashboard {
        padding: 25px;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    .dashboard-header {
        padding: 1.5rem 2rem;
    }
    
    .dashboard-title {
        font-size: 1.8rem;
    }
    
    .brand-section {
        min-height: 250px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .tile:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        box-shadow: var(--shadow-light);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .btn, .floating-badge {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    .card {
        border: 2px solid #333;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tile:hover {
        transform: none;
    }
}

/* Common Page Elements - Ensure Consistency */
.content {
    padding: 25px;
}

.bg-primary, .bg-gradient-primary {
    background: var(--primary-gradient) !important;
    color: white !important;
}

/* Remove any conflicting animations */
@keyframes backgroundMove,
@keyframes slideIn,
@keyframes fadeInUp,
@keyframes pulse,
@keyframes shine,
@keyframes highlight,
@keyframes spin {
    /* All animations disabled for smooth performance */
}

/* Ensure consistent form styling */
input[type="search"],
input[type="text"].form-control,
.search-box input {
    font-size: 16px !important; /* Prevents zoom on iOS */
}

/* Consistent table styling */
.table thead th {
    background: var(--light);
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Consistent badge/icon styling */
.user-icon, .icon-wrapper {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}
