/* Mobile-First CSS - Base styles are for mobile devices */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 4px;
    line-height: 1.3;
    font-size: 14px; /* Slightly smaller base font size */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 12px;
    text-align: center;
    position: relative;
    min-height: 70px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    margin-bottom: 12px; /* More padding between buttons and title */
    white-space: nowrap;
}

.lang-flag {
    font-size: 1.1rem;
    margin-right: 4px;
    display: inline-block;
    vertical-align: middle;
}

.lang-link {
    color: white;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s, background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lang-link:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.lang-link.active {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.lang-separator {
    opacity: 0.6;
    color: white;
}

header h1 {
    font-size: 1.4rem; /* Larger for better visibility */
    margin-bottom: 2px;
    font-weight: 600;
    line-height: 1.2;
    padding-top: 0;
    margin-top: 0;
}

.subtitle {
    font-size: 0.95rem; /* Larger subtitle */
    opacity: 0.95;
    line-height: 1.2;
}

.representative-card {
    padding: 10px 12px;
}

.info-section {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.info-section h2 {
    color: #667eea;
    font-size: 1.2rem; /* Larger heading */
    margin-bottom: 8px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 4px;
    line-height: 1.2;
}

.info-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.info-row .info-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    font-size: 1rem; /* Larger font size */
    align-items: flex-start;
}

.info-row .info-item:first-child {
    flex: 1 1 100%; /* Name always takes full width on mobile */
    margin-bottom: 6px;
}

.info-row .info-item:nth-child(2),
.info-row .info-item:nth-child(3) {
    flex: 1 1 calc(50% - 4px); /* Chamber and Area side by side */
    min-width: 100px;
}

.info-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    font-size: 0.9rem; /* Slightly smaller */
    align-items: flex-start;
}

.info-item .label {
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    font-size: 0.85rem; /* Larger label */
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.info-item .value {
    color: #555;
    font-size: 1.05rem; /* Larger value text */
    word-break: break-word;
}

.info-item.name-with-photo {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
}

.rep-photo-container {
    flex-shrink: 0;
}

.rep-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.name-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.info-item.phone {
    background: #e8f4f8;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    margin-top: 2px;
}

.phone-link {
    color: #667eea;
    text-decoration: none;
    font-size: 1.2rem; /* Larger phone number */
    font-weight: 700;
    display: inline-block;
    padding: 2px 0;
    min-height: 44px; /* Keep minimum touch target size */
    line-height: 1.3;
    word-break: break-all;
}

.phone-link:active {
    color: #764ba2;
    text-decoration: underline;
}

.message-section {
    margin-top: 8px;
}

.message-section h2 {
    color: #667eea;
    font-size: 1.2rem; /* Larger heading */
    margin-bottom: 8px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 4px;
    line-height: 1.2;
}

.message-box {
    background: #fff9e6;
    border: 2px solid #ffd700;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 1.1rem; /* Larger, more readable on mobile */
    line-height: 1.5;
    color: #333;
    margin-bottom: 8px;
}

.message-box p {
    margin-bottom: 6px;
}

.message-box p:last-child {
    margin-bottom: 0;
}

.message-box strong {
    color: #667eea;
    font-weight: 700;
}

.call-button-container {
    text-align: center;
    margin-top: 10px;
    padding: 0 10px;
}

.call-button {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 20px;
    font-size: 1.2rem; /* Larger call button text */
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 48px; /* Slightly smaller but still good touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.call-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.error-message {
    padding: 30px 20px;
    text-align: center;
    color: #d32f2f;
    font-size: 1.1rem;
    line-height: 1.6;
}

footer {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: center;
    color: #666;
    font-size: 0.9rem; /* Larger footer text */
    border-top: 1px solid #e0e0e0;
    line-height: 1.3;
}

/* Tablet and larger screens - min-width approach (mobile-first) */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        max-width: 800px;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
    
    header {
        padding: 25px 25px;
        min-height: 100px;
    }
    
    .lang-switcher {
        margin-bottom: 15px; /* More padding between buttons and title on desktop */
        font-size: 0.9rem;
    }
    
    .lang-link {
        padding: 5px 10px;
    }
    
    header h1 {
        font-size: 2rem; /* 32px on desktop */
        margin-bottom: 6px;
        padding-top: 0;
        margin-top: 0;
    }
    
    .subtitle {
        font-size: 1rem; /* 16px on desktop */
    }
    
    .representative-card {
        padding: 25px 20px;
    }
    
    .info-section {
        padding: 20px;
        margin-bottom: 18px;
    }
    
    .info-section h2 {
        font-size: 1.5rem; /* 24px on desktop */
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .info-row {
        flex-direction: row;
        gap: 20px;
        margin-bottom: 12px;
    }
    
    .info-row .info-item {
        flex: 1;
        flex-direction: column;
        margin-bottom: 0;
        font-size: 1rem;
        align-items: flex-start;
    }
    
    .info-row .info-item:first-child {
        flex: 1 1 auto; /* Name can be side by side on desktop */
        margin-bottom: 0;
    }
    
    .info-row .info-item.name-with-photo {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .info-row .info-item:nth-child(2),
    .info-row .info-item:nth-child(3) {
        flex: 1 1 auto; /* Chamber and Area side by side on desktop */
    }
    
    .info-item {
        flex-direction: row;
        margin-bottom: 12px;
        font-size: 1rem;
        align-items: center;
    }
    
    .info-item .label {
        min-width: 120px;
        margin-right: 12px;
        margin-bottom: 0;
        font-size: 0.9rem;
    }
    
    .info-item .value {
        flex: 1;
        font-size: 1rem;
    }
    
    .info-item.name-with-photo {
        gap: 16px;
        flex-direction: row !important;
        align-items: flex-start;
    }
    
    .rep-photo {
        width: 80px;
        height: 80px;
        border-radius: 10px;
    }
    
    .name-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    
    .name-content .label {
        margin-bottom: 2px;
    }
    
    .info-item.phone {
        padding: 12px;
        margin-top: 0;
    }
    
    .phone-link {
        font-size: 1.15rem;
        padding: 0;
        min-height: auto;
    }
    
    .phone-link:hover {
        color: #764ba2;
        text-decoration: underline;
    }
    
    .message-section {
        margin-top: 18px;
    }
    
    .message-section h2 {
        font-size: 1.5rem; /* 24px on desktop */
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .message-box {
        padding: 18px;
        font-size: 1.1rem; /* Larger for better readability */
        margin-bottom: 15px;
    }
    
    .message-box p {
        margin-bottom: 10px;
    }
    
    .call-button-container {
        margin-top: 18px;
        padding: 0;
    }
    
    .call-button {
        display: inline-block;
        width: auto;
        padding: 16px 40px;
        font-size: 1.3rem;
        border-radius: 50px;
        min-height: auto;
    }
    
    .call-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    }
    
    .call-button:active {
        transform: translateY(-1px);
    }
    
    .error-message {
        padding: 40px;
        font-size: 1.2rem;
    }
    
    footer {
        padding: 15px 20px;
        font-size: 0.9rem;
    }
}

/* Large desktop screens */
@media (min-width: 1024px) {
    .container {
        max-width: 900px;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .message-box {
        border-width: 4px;
    }
    
    .phone-link {
        text-decoration: underline;
    }
    
    .info-item.phone {
        border-left-width: 6px;
    }
}

/* Ensure touch targets are at least 44x44px on mobile */
@media (max-width: 767px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .lang-switcher {
        margin-bottom: 10px; /* Consistent spacing on mobile */
        font-size: 0.8rem;
    }
    
    .lang-link {
        padding: 3px 6px;
        min-height: 32px;
        min-width: auto;
        display: inline-flex;
        align-items: center;
    }
    
    header {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}
