/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

/* Group Management Container */
#gm_container {
    padding: 0;
    border: none;
    border-radius: 0;
    margin: 0;
    max-width: none;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* Modern Container */
.gm-modern-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    margin: 20px;
    overflow: hidden;
}

/* Modern Header */
.gm-modern-header {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.gm-modern-header h1 {
    font-size: 28px;
    color: white;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: none;
}

.gm-modern-header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Sections Container */
.gm-sections-container {
    padding: 30px;
}

/* Section Cards */
.gm-section-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gm-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.gm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gm-section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.gm-section-icon {
    font-size: 24px;
    background: #003366;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section Content */
.gm-section-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input Groups */
.gm-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gm-modern-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.gm-modern-input:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
    background: #fafbfc;
}

.gm-input-hint {
    font-size: 14px;
    color: #718096;
    font-style: italic;
}

/* Modern Buttons */
.gm-modern-button {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.gm-modern-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gm-modern-button:active {
    transform: translateY(0);
}

.gm-modern-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gm-primary-button {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
}

.gm-primary-button:hover {
    background: linear-gradient(135deg, #002244 0%, #003366 100%);
}

.gm-secondary-button {
    background: linear-gradient(135deg, #39cabb 0%, #2e9c8b 100%);
    color: white;
}

.gm-secondary-button:hover {
    background: linear-gradient(135deg, #2e9c8b 0%, #1e7d6f 100%);
}

.gm-button-icon {
    font-size: 18px;
}

/* Divider Section */
.gm-divider-section {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.gm-divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.gm-divider-text {
    padding: 0 20px;
    color: #718096;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Help Link */
.gm-help-link {
    text-align: center;
    margin-top: 15px;
}

.gm-learn-more {
    color: #003366;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gm-learn-more:hover {
    color: #002244;
    text-decoration: underline;
}

.gm-link-icon {
    font-size: 16px;
}

/* Modern Messages */
.gm-modern-message {
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    border: 2px solid transparent;
}

.gm-message-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.gm-message-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Loading State */
.gm-loading {
    opacity: 0.7;
    pointer-events: none;
}

.gm-loading:after {
    content: " ...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 33% { content: " ."; }
    34%, 66% { content: " .."; }
    67%, 100% { content: " ..."; }
}

/* Dashboard Styles */
.gm-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.gm-dashboard-header {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    text-align: center;
}

.gm-dashboard-header h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.gm-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.gm-info p {
    margin: 0;
    font-size: 16px;
}

.gm-code {
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    color: #39cabb;
}

.gm-role {
    text-transform: capitalize;
    font-weight: bold;
    color: #39cabb;
}

/* Tabbed Interface - FIXED EQUAL WIDTH */
.gm-tabs-container {
    margin: 20px 0;
    width: 100%;
    min-height: 500px;
}

.gm-tabs-navigation {
    display: flex;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
}

/* PERFECTLY EQUAL WIDTH FOR ALL TABS - FIXED */
.gm-tab-button {
    flex: 1;
    min-width: 0;
    width: 100%; /* Ensures equal width distribution */
    padding: 15px 5px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-right: 1px solid #e2e8f0;
}

/* Remove border from last tab */
.gm-tab-button:last-child {
    border-right: none;
}

.gm-tab-button:hover {
    background: #f1f5f9;
    color: #334155;
}

.gm-tab-button.active {
    background: white;
    color: #003366;
    border-bottom: 3px solid #003366;
}

.gm-tab-content {
    display: none;
    padding: 20px;
    background: white;
    border-radius: 0 0 12px 12px;
    border: 1px solid #e2e8f0;
    border-top: none;
    width: 100%;
    min-height: 450px;
    height: 450px;
    overflow-y: auto;
}

.gm-tab-content.active {
    display: block;
}

/* Tab Icons */
.gm-tab-icon {
    font-size: 18px;
    display: block;
}

.gm-tab-text {
    font-size: 12px;
    font-weight: 600;
    display: block;
}

/* Chat Tab Styles */
.gm-chat-tab {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: 100%;
}

/* Location Updates Section */
.gm-location-updates {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    width: 100%;
    flex: 1;
    min-height: 260px;
}

.gm-location-updates h4 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.gm-location-list {
    height: 120px;
    overflow-y: auto;
    width: 100%;
}

.gm-no-locations {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

.gm-location-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.gm-location-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gm-help-badge {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.gm-home-badge {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.gm-auto-badge {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.gm-location-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
    font-size: 14px;
}

.gm-location-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.gm-location-user {
    font-weight: 600;
    color: #1f2937;
    flex-shrink: 0;
}

.gm-location-action {
    color: #6b7280;
    font-size: 12px;
    flex-shrink: 0;
}

.gm-location-name {
    color: #374151;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.gm-location-map a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.gm-location-map a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.gm-location-time {
    color: #9ca3af;
    font-size: 11px;
    margin-top: 4px;
}

/* Voice Messages Section */
.gm-voice-messages-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px 15px 1px 15px;
    border: 1px solid #e2e8f0;
    width: 100%;
    flex: 2;
    min-height: 720px !important;
}

.gm-voice-messages-section h4 {
    color: #374151;
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.gm-voice-recorder {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.gm-instruction {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #374151;
    margin-bottom: 1rem;
    padding: 0 10px;
}

.gm-controls {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.gm-status {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-align: center !important;
}

#gm_message {
    font-size: 13px !important;
    margin-top: 0.8rem !important;
    text-align: center !important;
    padding: 0 10px !important;
}

.gm-ok {
    color: #16a34a;
}

.gm-warn {
    color: #ef4444;
}

.gm-voice-messages-container {
    position: relative;
    margin-top: 12px;
    width: 100%;
    height: 150px;
}

.gm-voice-messages-scroll {
    margin-top: 80px;
    height: 150px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    padding: 6px;
    scroll-behavior: smooth;
    width: 100%;
}

/* Hide scrollbar for cleaner look but keep functionality */
.gm-voice-messages-scroll::-webkit-scrollbar {
    width: 4px;
}

.gm-voice-messages-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.gm-voice-messages-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.gm-voice-messages-scroll::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Updated Voice Message Items - Single Line Layout */
.gm-voice-messages-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

.gm-voice-message-item {
    background-color: #fff;
    padding: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-left: 4px solid #2563eb;
    min-height: auto;
    width: 100%;
}

.gm-voice-message-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Single Line Header */
.gm-message-header-single-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #374151;
    margin-bottom: 0;
    padding: 0.2rem 0;
    background-color: transparent;
    border-radius: 0;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
}

.gm-sender-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.gm-sender-info strong {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.8rem;
}

.gm-sender-role {
    font-size: 0.7rem;
    color: #6b7280;
    font-style: italic;
}

.gm-message-time {
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Audio Player Adjustments */
.gm-item-audio {
    width: 100%;
    margin-top: 0.4rem;
    height: 35px;
    min-width: 0;
}

/* Remove message actions */
.gm-message-actions {
    display: none;
}

/* Play button removal */
.gm-play-button,
.gm-delete-message {
    display: none;
}

/* Real-time messaging styles */
.gm-live-indicator {
    font-size: 0.7rem;
    color: #10b981;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* New message animation */
.gm-new-message {
    animation: slideInDown 0.5s ease-out;
}

.gm-message-appear {
    background-color: #fef3c7 !important;
    border-left: 4px solid #f59e0b !important;
}

@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Group message styling */
.gm-own-message {
    border-left: 4px solid #10b981 !important;
    background-color: #f0fdf4 !important;
}

.gm-you-indicator {
    font-size: 0.7rem;
    color: #10b981;
    font-weight: bold;
    margin-left: 4px;
}

/* Members Tab Styles */
.gm-members-tab {
    padding: 10px;
    width: 800px;
    height: 100%;
}

.gm-members-list {
    margin: 12px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 38%;
    height: 380px;
    overflow-y: auto;
}

.gm-members-list h4 {
    margin-bottom: 12px;
    color: #374151;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.gm-members-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.gm-member {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
}

.gm-member:last-child {
    border-bottom: none;
}

.gm-member:hover {
    background-color: #f9fafb;
    border-radius: 6px;
}

.gm-member.gm-admin {
    background-color: #f0f8ff;
    font-weight: bold;
}

.gm-member.gm-special {
    background-color: #fff0f5;
    font-weight: bold;
}

.gm-member-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gm-member-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gm-badge {
    background: #0073aa;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.gm-badge.gm-special {
    background: #ff69b4;
}

/* Admin Tab Styles */
.gm-admin-tab {
    padding: 10px;
    width: 100%;
    height: 100%;
}

.gm-admin-options {
    background: #fff8e5;
    padding: 15px;
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid #ffb900;
    width: 100%;
    height: 380px;
    overflow-y: auto;
}

.gm-admin-options h4 {
    margin-top: 0;
    color: #745c00;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Automatic Location Sharing Section */
.gm-auto-sharing-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.gm-auto-sharing-section h4 {
    color: #374151;
    margin-bottom: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.gm-auto-sharing-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 8px;
}

.gm-auto-sharing-status.gm-active {
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    color: #166534;
}

.gm-auto-sharing-status.gm-inactive {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.gm-status-text {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.gm-status-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.gm-auto-sharing-info {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

.gm-note {
    font-size: 11px;
    color: #745c00;
    margin: 5px 0 0;
    text-align: center;
    font-style: italic;
}

.gm-actions {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    width: 100%;
}

/* Special Dashboard Styles */
.gm-special-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
}

.gm-special-header {
    text-align: center;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
}

.gm-special-header h3 {
    color: white;
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 700;
}

.gm-special-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
}

.gm-special-btn {
    padding: 16px 12px;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.gm-special-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gm-special-btn:active {
    transform: translateY(-1px);
}

.gm-special-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gm-call-home {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.gm-need-help {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.gm-at-home {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* Location Notifications */
.gm-location-notification {
    position: fixed;
    top: 15px;
    right: 15px;
    left: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease-out;
    max-width: none;
    font-size: 14px;
    text-align: center;
}

.gm-location-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gm-location-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.gm-location-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Original styles remain unchanged below */
.gm-button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #39cabb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin: 6px 0;
}

.gm-button:hover {
    background-color: #2e9c8b;
    transform: translateY(-1px);
}

.gm-button:active {
    transform: translateY(0);
}

.gm-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.gm-button.gm-primary {
    background-color: #003366;
}

.gm-button.gm-primary:hover {
    background-color: #002244;
}

.gm-button.gm-danger {
    background-color: #dc3232;
}

.gm-button.gm-danger:hover {
    background-color: #b22222;
}

.gm-small-button {
    padding: 6px 12px;
    font-size: 11px;
    margin-left: 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0073aa;
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

.gm-small-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Error Styles */
.gm-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin: 8px 0;
    font-weight: 500;
    font-size: 14px;
}

/* Loading States */
.gm-loading {
    text-align: center;
    padding: 15px;
    color: #6b7280;
    font-size: 14px;
}

.gm-loading-spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Disabled States */
.gm-button:disabled,
.gm-special-btn:disabled,
.gm-modern-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Voice Message Improvements */
.gm-voice-message-item {
    position: relative;
}

.gm-item-audio {
    width: 100%;
    max-width: 100%;
}

/* Notification Improvements */
.gm-location-notification,
.gm-new-message-notification {
    z-index: 10000;
    font-weight: 500;
}

/* Admin Options Styling */
.gm-admin-options {
    background: #fff8e5;
    border: 1px solid #fed7aa;
}

.gm-auto-sharing-section {
    background: white;
    border: 1px solid #e5e7eb;
}

/* Member List Improvements */
.gm-members-list ul {
    max-height: 300px;
    overflow-y: auto;
}

/* New message notification */
.gm-new-message-notification {
    position: fixed;
    top: 15px;
    right: 15px;
    left: 15px;
    background: #10b981;
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-weight: bold;
    animation: slideInRight 0.5s ease-out;
    text-align: center;
    font-size: 14px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading message state */
.gm-messages-loading {
    text-align: center;
    padding: 15px;
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

/* No messages state */
.gm-no-messages {
    text-align: center;
    padding: 30px 15px;
    color: #9ca3af;
    font-style: italic;
    background: white;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
    font-size: 14px;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .gm-modern-container {
        margin: 10px;
        width: 100%;
        border-radius: 16px;
    }
    
    .gm-modern-header {
        padding: 25px 15px;
    }
    
    .gm-modern-header h1 {
        font-size: 22px;
    }
    
    .gm-modern-header p {
        font-size: 14px;
    }
    
    .gm-sections-container {
        padding: 20px;
    }
    
    .gm-section-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .gm-section-header h2 {
        font-size: 18px;
    }
    
    .gm-modern-input, .gm-modern-button {
        font-size: 14px;
        padding: 14px;
    }
    
    .gm-dashboard {
        padding: 15px;
    }
    
    .gm-dashboard-header {
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .gm-dashboard-header h3 {
        font-size: 20px;
    }
    
    .gm-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .gm-info p {
        font-size: 14px;
    }
    
    .gm-code, .gm-role {
        font-size: 16px;
    }
    
    /* Tabs - PERFECTLY EQUAL WIDTH - FIXED */
    .gm-tabs-navigation {
        flex-direction: row;
        border-radius: 8px 8px 0 0;
    }
    
    .gm-tab-button {
        padding: 12px 5px;
        font-size: 12px;
        min-height: 50px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        min-width: 0;
        width: 100%; /* Ensures equal width */
    }
    
    .gm-tab-icon {
        font-size: 16px;
    }
    
    .gm-tab-text {
        font-size: 11px;
        font-weight: 600;
    }
    
    .gm-tab-content {
        padding: 15px;
        border-radius: 0 0 8px 8px;
        min-height: 500px;
        height: 500px;
    }
    
    /* Adjust heights for mobile */
    .gm-members-list,
    .gm-admin-options {
        height: 400px;
    }
    
    .gm-voice-messages-container {
        height: 120px;
    }
    
    .gm-voice-messages-scroll {
        height: 500px;
        margin-top: 0px !important;
    }
    
    .gm-location-list {
        height: 190px;
    }
    
    /* Special buttons grid adjustment */
    .gm-special-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .gm-special-btn {
        min-height: 60px;
        font-size: 14px;
        padding: 14px 10px;
    }
    
    /* Auto-sharing status adjustment */
    .gm-auto-sharing-status {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .gm-status-controls {
        justify-content: center;
    }
    
    /* Location header adjustment */
    .gm-location-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    /* Controls adjustment */
    .gm-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .gm-button {
        margin: 4px 0;
    }
    
    /* Message header adjustment */
    .gm-message-header-single-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    /* Voice messages scroll adjustment */
    .gm-voice-message-item {
        min-height: 60px;
        padding: 0.6rem;
    }
    
    .gm-instruction {
        font-size: 13px;
        padding: 0 8px;
    }
    
    /* Member actions adjustment */
    .gm-member-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gm-modern-container {
        margin: 5px;
        border-radius: 12px;
    }
    
    .gm-modern-header {
        padding: 20px 12px;
    }
    
    .gm-modern-header h1 {
        font-size: 20px;
    }
    
    .gm-modern-header p {
        font-size: 13px;
    }
    
    .gm-sections-container {
        padding: 15px;
    }
    
    .gm-section-card {
        padding: 15px;
    }
    
    .gm-tab-button {
        padding: 10px 3px;
        font-size: 11px;
        min-height: 45px;
    }
    
    .gm-tab-icon {
        font-size: 14px;
    }
    
    .gm-tab-text {
        font-size: 10px;
    }
    
    .gm-tab-content {
        padding: 12px;
        min-height: 500px;
        height: 500px;
    }
    
    /* Adjust heights for small mobile */
    .gm-members-list,
    .gm-admin-options {
        height: 400px;
    }
    
    .gm-special-buttons {
        grid-template-columns: 1fr;
    }
    
    .gm-special-btn {
        min-height: 55px;
        font-size: 13px;
        padding: 12px 8px;
    }
    
    .gm-voice-message-item {
        min-height: 55px;
        padding: 0.5rem;
    }
    
    .gm-instruction {
        font-size: 12px;
        padding: 0 6px;
    }
    
    .gm-location-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .gm-member {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .gm-member-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 360px) {
    .gm-tab-button {
        font-size: 10px;
        padding: 8px 2px;
        min-height: 40px;
    }
    
    .gm-tab-icon {
        font-size: 12px;
    }
    
    .gm-tab-text {
        font-size: 9px;
    }
    
    .gm-tab-content {
        padding: 10px;
        min-height: 350px;
        height: 350px;
    }
    
    /* Adjust heights for very small mobile */
    .gm-members-list,
    .gm-admin-options {
        height: 400px;
    }
    
    .gm-dashboard-header {
        padding: 15px;
    }
    
    .gm-dashboard-header h3 {
        font-size: 18px;
    }
    
    .gm-special-btn {
        font-size: 12px;
        min-height: 50px;
    }
}

/* Print Styles */
@media print {
    .gm-modern-container {
        box-shadow: none;
        background: white;
    }
    
    .gm-modern-header {
        background: #003366 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .gm-button,
    .gm-modern-button,
    .gm-special-btn {
        display: none;
    }
    
    .gm-tabs-navigation {
        display: none;
    }
    
    .gm-tab-content {
        display: block !important;
        border: none;
        padding: 0;
        height: auto !important;
        min-height: auto !important;
    }
}