/**
 * UdyamSales Main Styles
 * Responsive CSS Framework for all devices
 */

/* CSS Variables */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --black: #000000;
    --border-color: #dee2e6;
    --border-radius: 8px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-color: #0d6efd;
    --light-color: #212529;
    --dark-color: #f8f9fa;
    --white: #1a1a1a;
    --black: #ffffff;
    --border-color: #495057;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--black);
    background-color: var(--white);
    overflow-x: hidden;
    padding-bottom: 80px; /* Space for mobile bottom nav */
}

/* Container System */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--white);
    color: var(--black);
    transition: var(--transition);
    min-height: 48px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control::placeholder {
    color: var(--secondary-color);
}

/* Cards */
.card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    background-color: var(--light-color);
    border-top: 1px solid var(--border-color);
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 2rem; }

.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: 2rem; }

.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: 2rem; }

.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: 2rem; }

/* Responsive Breakpoints */

/* Mobile First (Default) - Up to 767px */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }
    
    body {
        padding-bottom: 80px; /* Bottom navigation space */
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .btn {
        min-height: 48px; /* Larger touch targets on mobile */
        padding: 0.75rem 1rem;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-lg {
        min-height: 56px;
        padding: 1rem 1.5rem;
    }
    
    .form-control {
        min-height: 48px;
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Tablet - 768px to 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    html {
        font-size: 15px;
    }
    
    body {
        padding-bottom: 0; /* No bottom nav on tablet */
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

/* Desktop - 1024px and up */
@media (min-width: 1024px) {
    html {
        font-size: 16px;
    }
    
    body {
        padding-bottom: 0;
    }
    
    .container {
        padding: 0 2rem;
    }
}

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

/* Extra Large Desktop - 1400px and up */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Dark Theme Adjustments */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .card {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    background: #1a202c;
    border-color: #4a5568;
}

[data-theme="dark"] .form-control {
    background: #2d3748;
    border-color: #4a5568;
    color: var(--white);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--white);
}

/* Print Styles */
@media print {
    body {
        padding-bottom: 0 !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    .btn {
        border: 1px solid #000;
        background: transparent;
        color: #000;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
}
