/* MOBILE-ONLY CSS - Optimized for touch devices */
/* Base viewport: 375px - 414px (typical mobile widths) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

/* Typography - Mobile Optimized */
h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin: 0.75rem 0;
    padding: 0 1rem;
    line-height: 1.3;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #34495e;
    margin: 1rem 0 0.5rem;
    padding: 0 1rem;
}

h2.big {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #34495e;
    margin: 0.75rem 0 0.5rem;
    padding: 0 1rem;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: #34495e;
}

p {
    margin: 0.5rem 0;
    padding: 0 1rem;
}

/* Top Header - Mobile */
.topheader {
    background: #007bff;
    color: white;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.email_header {
    display: block;
    margin-bottom: 0.5rem;
}

.header_right {
    font-size: 1rem;
    color: white;
    margin: 0;
}

.currency_header {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Menu Header - Mobile */
.menu_header {
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu_header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.menu_header h1 a {
    color: #2c3e50 !important;
    text-decoration: none;
}

.menu_header p {
    font-size: 0.875rem;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 0.75rem;
    padding: 0;
}

/* Search Box - Mobile Optimized */
#search-box {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    outline: none;
}

#search-box:focus {
    border-color: #007bff;
}

#search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 100;
}

.search-result {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.search-result:active {
    background: #f0f0f0;
}

.search-result img {
    width: 30px;
    height: 30px;
    margin-right: 0.75rem;
    vertical-align: middle;
}

/* Main Content Container */
.table_container_Ese {
    background: white;
    margin: 1rem 0.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Company Header Section - Mobile */
.row {
    display: block;
    padding: 1rem;
}

.col-lg-2, .col-lg-4, .col-lg-6 {
    width: 100%;
    padding: 0;
}

.company-logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.company-profile-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
}

.company-title-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.company-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.company-code {
    font-size: 1rem;
    color: #7f8c8d;
}

/* Info Boxes - Mobile Grid */
.info-box {
    width: 50%;
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.info-box:nth-child(even) {
    border-right: none;
}

.info-box .line1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.info-box .line2 {
    font-size: 0.75rem;
    color: #95a5a6;
    margin-top: 0.25rem;
}

/* Company Description - Mobile */
.company-description {
    padding: 1rem;
    background: #f8f9fa;
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Navigation Tabs - Mobile */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    padding: 0.75rem 1rem;
    color: #7f8c8d;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.nav-link.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    margin-bottom: -2px;
}

/* Profile Container - Mobile */
.profile-container {
    padding: 1rem;
    background: white;
}

/* Chart Container - Mobile */
canvas {
    max-width: 100%;
    height: auto !important;
    margin: 1rem 0;
}

/* Tables - Mobile Optimized */
.table {
    width: 100%;
    font-size: 0.875rem;
}

.table thead {
    background: #f8f9fa;
}

.table th {
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    text-align: left;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    background: #f8f9fa;
}

.table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.name-td {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem !important;
}

.company-logo {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    border-radius: 8px;
}

.name-div {
    flex: 1;
}

.name-div .company-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2c3e50;
}

.name-div .company-code {
    font-size: 0.75rem;
    color: #95a5a6;
}

/* Percentage Indicators */
.percentage-green, .green {
    color: #27ae60;
    font-weight: 600;
}

.percentage-red, .red {
    color: #e74c3c;
    font-weight: 600;
}

/* Background Highlight */
.background-ya {
    background-color: #fff59d;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Footer - Mobile */
.footer-container {
    background: #f5f7f7;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
}

.footer-section {
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section h1 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.footer-section h4 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
}

.col-sm-6 {
    width: 100%;
    margin-bottom: 1.5rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.centered {
    text-align: center;
}

.noshadow {
    box-shadow: none !important;
}

.margin-lr-15px {
    margin-left: 1rem;
    margin-right: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.pt-3 {
    padding-top: 0.75rem;
}

.w-100 {
    width: 100%;
}

/* Scrollable Areas */
div[style*="overflow-y: scroll"] {
    max-height: 400px;
    -webkit-overflow-scrolling: touch;
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
}

a:active {
    opacity: 0.7;
}

/* Contact Email */
.contact-email {
    word-break: break-all;
    font-size: 0.875rem;
}

/* Update Info */
.UpdateBourseCasa {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
}

.UpdateBourseCasaDate {
    font-weight: 600;
}

#MiseaJour, .MiseaJour_bottom {
    font-size: 0.75rem;
    font-style: italic;
    text-align: center;
    color: #7f8c8d;
}

/* Favorite Button - Mobile */
.favorite-btn {
    background: none;
    border: none;
    padding: 0.5rem;
}

.favorite-btn img {
    width: 24px;
    height: 24px;
}

/* Touch Feedback */
button, a, .nav-link, .search-result {
    -webkit-tap-highlight-color: rgba(0,123,255,0.1);
}

/* Prevent Horizontal Scroll */
* {
    max-width: 100vw;
}

/* iOS Specific Fixes */
input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        font-size: 12pt;
    }
}