/* Irish Sailing brand colors and professional maritime theme */
:root {
    /* Irish Sailing Primary Colors (Pantone 343 & 369) */
    --primary-green: #00704A;     /* Dark Green - Pantone 343 */
    --secondary-green: #7CB342;   /* Light Green - Pantone 369 */
    --accent-green: #004D32;      /* Darker accent green */
    --light-green: #A5D152;       /* Lighter tint */

    /* Neutral Maritime Colors */
    --navy-blue: #1B365D;         /* Professional navy */
    --ocean-blue: #2E5E82;        /* Ocean blue accent */
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --dark-gray: #343A40;
    --border-light: #DEE2E6;

    /* Status Colors */
    --success-color: var(--secondary-green);
    --danger-color: #DC3545;
    --warning-color: #FFC107;
    --info-color: var(--ocean-blue);

    /* Typography */
    --font-primary: 'Helvetica Neue', 'Arial', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: #e5e7eb;
    color: var(--dark-gray);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
}

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* Container and Layout */
.container {
    width: 100%;
    min-height: 100vh;
    background: #e5e7eb;
}

/* Header Navigation */
.header {
    background: var(--primary-green);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 112, 74, 0.15);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-title p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.25rem 0 0 0;
    font-weight: 300;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
}

.user-role {
    font-size: 0.75rem;
    background: var(--secondary-green);
    color: var(--white);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
    display: inline-block;
}

.logout-btn {
    background: var(--danger-color);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #C82333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
}

/* Main Menu Screen Layout */
.main-menu-screen {
    min-height: 100vh;
    background: #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
}

.user-info-bar {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 10;
}

.user-welcome {
    background: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.admin-badge {
    background: var(--warning-color);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-header {
    text-align: center;
    padding: 3rem 2rem 2rem 2rem;
    margin-top: 2rem;
}

.app-icon-large {
    font-size: 5rem;
    margin-bottom: 1rem;
    display: block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.app-title-main {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.app-subtitle {
    font-size: 1.2rem;
    color: var(--medium-gray);
    font-weight: 300;
    margin: 0;
}

.main-menu-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.menu-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    width: 100%;
}

.main-menu-btn {
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.main-menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.main-menu-btn:hover::before {
    opacity: 0.05;
}

.main-menu-btn:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 112, 74, 0.2);
    border-color: var(--secondary-green);
}

.main-menu-btn:active {
    transform: translateY(-4px) scale(1.01);
    transition: all 0.1s ease;
}

/* iPad specific hover effects (touch devices) */
@media (hover: none) and (pointer: coarse) {
    .main-menu-btn:hover {
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    }

    .main-menu-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .tab-btn:hover {
        transform: none;
        background: #9ca3af;
    }

    .tab-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Orientation change handling */
@media (orientation: landscape) and (max-height: 500px) {
    .app-header {
        padding: 1rem;
    }

    .app-icon-large {
        font-size: 3rem;
        margin-bottom: 0.5rem;
    }

    .app-title-main {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .app-subtitle {
        font-size: 0.9rem;
    }
}

.menu-btn-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-green);
    position: relative;
    z-index: 2;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.menu-btn-text {
    position: relative;
    z-index: 2;
}

.menu-btn-text h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.menu-btn-text p {
    font-size: 1rem;
    color: var(--medium-gray);
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
}

/* Admin Button Styling */
.admin-btn {
    border-color: var(--warning-color);
}

.admin-btn::before {
    background: linear-gradient(135deg, var(--warning-color), #E0A800);
}

.admin-btn:hover {
    border-color: var(--warning-color);
    box-shadow: 0 20px 40px rgba(255, 193, 7, 0.25);
}

.admin-btn .menu-btn-icon {
    color: var(--warning-color);
}

.admin-btn .menu-btn-text h3 {
    color: var(--warning-color);
}

/* Logout Button Styling */
.logout-menu-btn {
    border-color: var(--danger-color);
}

.logout-menu-btn::before {
    background: linear-gradient(135deg, var(--danger-color), #C82333);
}

.logout-menu-btn:hover {
    border-color: var(--danger-color);
    box-shadow: 0 20px 40px rgba(220, 53, 69, 0.25);
}

.logout-menu-btn .menu-btn-icon {
    color: var(--danger-color);
}

.logout-menu-btn .menu-btn-text h3 {
    color: var(--danger-color);
}

/* iPad and Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-menu-btn {
        padding: 3rem 2.5rem;
        min-height: 220px;
    }

    .menu-btn-icon {
        font-size: 5rem;
        margin-bottom: 2rem;
    }

    .menu-btn-text h3 {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }

    .menu-btn-text p {
        font-size: 1.1rem;
    }

    .menu-buttons-grid {
        gap: 3rem;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch-optimized buttons */
.main-menu-btn,
.back-btn,
button,
.btn {
    min-height: 44px; /* Apple recommended touch target size */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Prevent text selection on touch devices */
.main-menu-btn,
.tab-btn,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* iOS Safe Area Support */
@supports (padding: env(safe-area-inset-top)) {
    .main-menu-screen {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Responsive Design for Main Menu */
@media (max-width: 768px) {
    .user-info-bar {
        position: static;
        padding: 1rem 1rem 0 1rem;
        display: flex;
        justify-content: center;
    }

    .user-welcome {
        margin: 0 auto;
    }

    .app-header {
        padding: 2rem 1rem 1rem 1rem;
        margin-top: 0;
    }

    .app-icon-large {
        font-size: 4rem;
    }

    .app-title-main {
        font-size: 2.2rem;
    }

    .app-subtitle {
        font-size: 1rem;
    }

    .main-menu-container {
        padding: 1rem;
    }

    .menu-buttons-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 400px;
    }

    .main-menu-btn {
        padding: 2rem 1.5rem;
        min-height: 160px;
        border-radius: 16px;
    }

    .menu-btn-icon {
        font-size: 3.5rem;
        margin-bottom: 1rem;
    }

    .menu-btn-text h3 {
        font-size: 1.25rem;
    }

    .menu-btn-text p {
        font-size: 0.9rem;
    }
}

/* Wind Indicator Styling */
.wind-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #ddd;
}

.wind-arrow {
    color: #333;
    font-size: 16px;
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Distance label styling for Leaflet markers */
.leaflet-marker-icon + .leaflet-marker-label {
    background: white !important;
    color: #333 !important;
    border: 1px solid #333 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* Popup styling for better readability */
.leaflet-popup-content {
    color: #333 !important;
    background: white !important;
}

.leaflet-popup-content-wrapper {
    background: white !important;
    border: 1px solid #333 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

@media (max-width: 480px) {
    .app-header {
        padding: 1.5rem 1rem 0.5rem 1rem;
    }

    .app-icon-large {
        font-size: 3.5rem;
    }

    .app-title-main {
        font-size: 1.8rem;
    }

    .main-menu-container {
        padding: 0.5rem;
    }

    .menu-buttons-grid {
        gap: 1rem;
    }

    .main-menu-btn {
        padding: 1.5rem 1rem;
        min-height: 140px;
        border-radius: 12px;
    }

    .menu-btn-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }

    .menu-btn-text h3 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .menu-btn-text p {
        font-size: 0.85rem;
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) and (min-width: 769px) {
    .menu-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .main-menu-btn {
        min-height: 180px;
    }

    .menu-btn-icon {
        font-size: 4rem;
    }
}

/* Keep existing styles for other pages */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.menu-item {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.menu-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 112, 74, 0.15);
    border-color: var(--secondary-green);
}

.menu-link {
    display: block;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.menu-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

.menu-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.menu-item p {
    color: var(--medium-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

.admin-item {
    border-color: var(--warning-color);
}

.admin-item:hover {
    border-color: var(--warning-color);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.2);
}

.admin-item .menu-icon {
    color: var(--warning-color);
}

.admin-item h3 {
    color: var(--warning-color);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 0.5rem;
    font-family: var(--font-primary);
}

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

.btn-primary:hover {
    background: var(--accent-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 112, 74, 0.3);
}

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

.btn-secondary:hover {
    background: #6A9F37;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
}

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

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

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

.btn-danger:hover {
    background: #C82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-gray);
}

.btn-warning:hover {
    background: #E0A800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-green);
    margin: 0;
}

.close {
    color: var(--medium-gray);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close:hover {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-light);
    border-radius: 6px;
        background-color: #e5e7eb;
    color: var(--dark-gray);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-primary);
}

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

.form-control:hover {
    border-color: var(--primary-green);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Flash Messages */
.flash-messages-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
}

.flash-success {
    background-color: var(--secondary-green);
    color: var(--white);
}

.flash-error {
    background-color: var(--danger-color);
    color: var(--white);
}

.flash-warning {
    background-color: var(--warning-color);
    color: var(--dark-gray);
}

.flash-info {
    background-color: var(--info-color);
    color: var(--white);
}

.flash-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    padding: 0.25rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.flash-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Course Setting Styles */
.course-setting {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.controls-panel {
    background-color: var(--secondary-bg);
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.back-button {
    margin-right: auto;
}

.back-btn {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-bg);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background-color: var(--accent-bg);
}

.course-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.input-group input,
.input-group select {
    height: 42px;
    padding: 0.75rem;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-bg);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.input-group input:hover,
.input-group select:hover {
    border-color: var(--text-secondary);
}

/* Ensure consistent appearance for number inputs */
.input-group input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.input-group input[type="number"]::-webkit-outer-spin-button,
.input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Consistent select dropdown styling */
.input-group select {
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23ffffff" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'Arial', sans-serif !important;
    font-weight: normal;
}

.course-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.control-btn {
    padding: 0.5rem 1rem;
    background-color: var(--accent-bg);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.control-btn:hover {
    background-color: #3b82f6;
}

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

.control-btn.danger:hover {
    background-color: #dc2626;
}

#map {
    flex: 1;
    position: relative;
}

/* Specific wind indicator for course setting/navigation maps */
.course-wind-indicator {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background-color: rgba(10, 22, 40, 0.9);
    padding: 1rem;
    border-radius: 50%;
    border: 2px solid var(--text-primary);
}

.course-wind-indicator .wind-arrow {
    font-size: 2rem;
    color: var(--text-primary);
    text-align: center;
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* Countdown Styles */
.countdown-screen {
    height: 100vh;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.countdown-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.countdown-container h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.timer-controls {
    margin-bottom: 2rem;
}

.duration-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.toggle-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-option:hover {
    background-color: var(--accent-bg);
}

.toggle-option input[type="radio"] {
    margin-right: 0.5rem;
}

.toggle-option input[type="radio"]:checked + span {
    font-weight: bold;
}

.start-btn,
.stop-btn,
.reset-btn {
    padding: 1rem 2rem;
    margin: 0 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.start-btn:hover {
    background-color: #059669;
}

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

.stop-btn:hover {
    background-color: #dc2626;
}

.reset-btn {
    background-color: var(--warning-color);
    color: white;
}

.reset-btn:hover {
    background-color: #d97706;
}

.timer-display {
    margin: 2rem 0;
}

#timer {
    font-size: 6rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.flag-status {
    font-size: 1.5rem;
    padding: 0.5rem 0;
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-weight: normal;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sequence-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 2rem;
}

.sequence-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: var(--secondary-bg);
    border-radius: 6px;
    min-width: 300px;
}

.sequence-item .time {
    font-weight: bold;
    color: var(--warning-color);
}

.sequence-item .flag {
    color: var(--text-secondary);
}

.voice-countdown-info {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.voice-countdown-info h3 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.voice-countdown-info p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.voice-countdown-info ul {
    color: var(--text-primary);
    margin-left: 1rem;
    font-size: 0.9rem;
}

.voice-countdown-info li {
    margin-bottom: 0.25rem;
}

/* Bluetooth Controls */
    .audio-controls {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .enable-audio-btn {
        padding: 0.75rem 1.5rem;
        background-color: var(--warning-color);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .enable-audio-btn:hover {
        background-color: #d97706;
    }

    .enable-audio-btn:disabled {
        background-color: var(--success-color);
        cursor: not-allowed;
    }

    .audio-status {
        font-size: 0.9rem;
        color: var(--text-secondary);
        text-align: center;
    }

    .audio-status.enabled {
        color: var(--success-color);
    }

    .audio-status.disabled {
        color: var(--warning-color);
    }

.bluetooth-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.bluetooth-btn {
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bluetooth-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.bluetooth-btn:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.bluetooth-btn.connected {
    background-color: #10b981;
}

.bluetooth-btn.connected:hover {
    background-color: #059669;
}

.bluetooth-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bluetooth-status.connected {
    color: var(--success-color);
}

.bluetooth-status.error {
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .course-inputs {
        justify-content: space-between;
    }

    .input-group {
        flex: 1;
        min-width: 100px;
    }

    .app-title {
        font-size: 2rem;
    }

    #timer {
        font-size: 4rem;
    }

    .sequence-item {
        min-width: auto;
    }
}

/* Custom Leaflet Styles */
.leaflet-container {
    background-color: var(--primary-bg);
}

.leaflet-popup-content-wrapper {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

.leaflet-popup-tip {
    background-color: var(--secondary-bg);
}

.distance-label {
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    border: 1px solid #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-shadow: none;
}

.navigation-line-label {
    background-color: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Marker popup styles */
.marker-popup {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

.marker-popup .coordinates {
    color: #666;
    font-size: 11px;
    margin: 8px 0;
}

.depth-info {
    margin-top: 10px;
    padding: 8px;
    background-color: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #0ea5e9;
}

.depth-loading {
    color: #0ea5e9;
    font-style: italic;
    font-size: 12px;
}

.depth-success {
    color: #0f172a;
    font-size: 12px;
}

.depth-success strong {
    color: #0ea5e9;
    display: block;
    margin-bottom: 4px;
}

.depth-metric {
    font-weight: bold;
    color: #1e40af;
}

.depth-imperial {
    color: #7c3aed;
}

.depth-fathoms {
    font-size: 11px;
    color: #059669;
    font-style: italic;
}

.depth-error {
    color: #dc2626;
    font-size: 12px;
}

.depth-error .error-text {
    font-style: italic;
}

/* Course marker popup styles */
.course-marker-popup {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    min-width: 200px;
}

.course-marker-popup .coordinates {
    color: #666;
    font-size: 11px;
    margin: 6px 0;
}

.course-marker-popup strong {
    color: #1e40af;
    font-size: 14px;
}

#boat-class {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

#boat-class option {
    padding: 4px;
}

#boat-class option[value=""] {
    color: #6b7280;
    font-style: italic;
}

.course-marker-popup hr {
    border: 0;
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

/* Dark theme adjustments for popups */
.leaflet-popup-content-wrapper {
    background-color: #ffffff;
    color: #1f2937;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-content-wrapper .depth-info {
    background-color: #eff6ff;
}

.leaflet-popup-tip {
    background-color: #ffffff;
}

/* Enhanced popup styling */
.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 13px;
}

.leaflet-popup-close-button {
    color: #6b7280;
    font-size: 18px;
    font-weight: bold;
    padding: 4px 8px;
}

.leaflet-popup-close-button:hover {
    color: #374151;
    background-color: #f3f4f6;
}

/* Navigation section in popups */
.navigation-section {
    margin-top: 10px;
}

.navigate-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.navigate-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.navigate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Navigation feedback */
.nav-feedback {
    margin-top: 8px;
    padding: 6px;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    font-weight: bold;
}

.nav-feedback-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.nav-feedback-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Global navigation notification animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile responsive adjustments for navigation */
@media (max-width: 768px) {
    .navigate-btn {
        font-size: 14px;
        padding: 10px;
    }

    .navigation-notification {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
    }
}

.save-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
}

.save-btn:hover {
    background-color: #059669;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form label {
    font-weight: bold;
    color: var(--text-secondary);
}

.settings-form select {
    padding: 0.5rem;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

/* Move together notification styles */
.move-together-notification {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Course update notification styles */
.course-update-notification {
    animation: slideInFromTop 0.3s ease-out;
}

/* Mark creation dialog styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.mark-creation-dialog {
    background-color: #1e293b;
    border: 2px solid #374151;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    color: white;
    animation: dialogSlideIn 0.2s ease-out;
}

.mark-creation-dialog h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: bold;
    color: #f59e0b;
    text-align: center;
}

.mark-creation-dialog p {
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #d1d5db;
    text-align: center;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dialog-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.confirm-btn {
    background-color: #10b981;
    color: white;
}

.confirm-btn:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cancel-btn {
    background-color: #6b7280;
    color: white;
}

.cancel-btn:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.dialog-btn:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mobile responsiveness for dialog */
@media (max-width: 768px) {
    .mark-creation-dialog,
    .delete-confirmation-dialog {
        margin: 20px;
        padding: 1.5rem;
        border-radius: 16px;
        max-width: none;
        width: calc(100% - 40px);
    }

    .mark-creation-dialog h3,
    .delete-confirmation-dialog h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .mark-creation-dialog p,
    .delete-confirmation-dialog p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    .warning-text {
        font-size: 0.9rem !important;
        margin-top: 0.5rem;
    }

    .dialog-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dialog-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 12px;
        font-weight: bold;
    }

    .confirm-btn:hover,
    .delete-btn:hover {
        transform: translateY(-2px);
    }

    .cancel-btn:hover {
        transform: translateY(-2px);
    }
}

/* Small mobile dialog adjustments */
@media (max-width: 480px) {
    .mark-creation-dialog,
    .delete-confirmation-dialog {
        margin: 15px;
        padding: 1.25rem;
        width: calc(100% - 30px);
    }

    .mark-creation-dialog h3,
    .delete-confirmation-dialog h3 {
        font-size: 1.2rem;
    }

    .dialog-btn {
        padding: 1rem 1.25rem;
        min-height: 52px;
        font-size: 1rem;
    }
}

/* Input with button styling */
.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
    height: 42px;
    padding: 0.75rem;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-button input:focus {
    outline: none;
    border-color: var(--accent-bg);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.input-with-button input:hover {
    border-color: var(--text-secondary);
}

.get-wind-btn {
    height: 42px;
    background-color: #0ea5e9;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 110px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.get-wind-btn:hover:not(:disabled) {
    background-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

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

.get-wind-btn:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

/* Wind update notification styles */
.wind-update-notification {
    animation: slideInFromTop 0.3s ease-out;
}

/* Start line styling */
.start-line {
    stroke-dasharray: 10, 8;
}

.start-line-label {
    background: rgba(34, 197, 94, 0.95);
    color: white;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.start-line-text {
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .get-wind-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 90px;
    }

    .input-with-button {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .input-with-button input,
    .get-wind-btn {
        width: 100%;
    }

    .start-line-label {
        font-size: 10px;
    }

    .start-line-text {
        font-size: 10px;
    }
}

/* Standalone/Fullscreen mode for iPad web app */
.standalone-mode {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.standalone-mode .main-menu-screen {
    padding-top: max(env(safe-area-inset-top), 20px);
}

.standalone-mode .course-screen {
    padding-top: max(env(safe-area-inset-top), 10px);
    padding-bottom: max(env(safe-area-inset-bottom), 10px);
}

/* Improved scrolling on iOS */
.course-settings {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* Better form styling for iPad */
@media (min-width: 768px) and (max-width: 1024px) {
    .form-group input,
    .form-group select {
        font-size: 16px !important; /* Prevent iOS zoom */
        border: 2px solid #d1d5db;
        transition: border-color 0.2s ease;
    }

    .form-group input:focus,
    .form-group select:focus {
        border-color: #3b82f6;
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
}

/* Enhanced toggle styling when active */
.toggle input:checked + .slider {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Leaflet marker styling enhancements */
.leaflet-marker-icon {
    transition: transform 0.2s ease;
}

.leaflet-marker-icon:hover {
    transform: scale(1.1);
}

.leaflet-marker-dragging {
    opacity: 0.7;
}

.gate-distance-label {
    color: #7c3aed;
    font-weight: bold;
    font-size: 9px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1px 3px;
    border-radius: 2px;
    border: 1px solid #7c3aed;
}

.spreader-distance-label {
    color: #ea580c;
    font-weight: bold;
    font-size: 9px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1px 3px;
    border-radius: 2px;
    border: 1px solid #ea580c;
}

.toggles-section {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.toggle-group {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.buttons-section {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Enhanced toggle switch styling */
.toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: .3s;
    border-radius: 26px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background-color: var(--success-color);
    box-shadow: inset 0 2px 4px rgba(16, 185, 129, 0.3), 0 0 8px rgba(16, 185, 129, 0.2);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

input:focus + .slider {
    outline: 2px solid var(--accent-bg);
    outline-offset: 2px;
}

/* Hover effects */
.toggle-label:hover .toggle-text {
    color: var(--text-primary);
}

.toggle-label:hover .slider {
    background-color: #64748b;
}

input:checked + .slider:hover {
    background-color: #059669;
}

/* Enhanced bearing line animation */
.bearing-line {
    animation: dashFlow 2s linear infinite;
}

@keyframes dashFlow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 20px;
    }
}

/* Popup styling enhancements */
.leaflet-popup-content {
    margin: 8px 12px;
    line-height: 1.4;
}

.leaflet-popup-content hr {
    border: 0;
    height: 1px;
    background: #374151;
    margin: 8px 0;
}

.leaflet-popup-content strong {
    color: #f59e0b;
}

/* Navigate Screen Styles */
.navigate-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--primary-bg);
    color: var(--text-primary);
}

.no-marks-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}


.no-marks-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-marks-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.setup-course-btn {
    background-color: var(--accent-bg);
    color: var(--text-primary);
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.setup-course-btn:hover {
    background-color: #3b82f6;
}

.navigation-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mark-selector {
    background-color: var(--secondary-bg);
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.mark-selector label {
    font-weight: bold;
    color: var(--text-secondary);
}

.mark-dropdown {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

.start-nav-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.start-nav-btn:hover:not(:disabled) {
    background-color: #059669;
}

.start-nav-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.navigation-display {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.heading-section {
    background-color: var(--secondary-bg);
    padding: 0.75rem; /* Reduced from 1rem */
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0; /* Prevent shrinking */
}

.compass-display {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.compass-rose {
    position: relative;
    width: 120px;
    height: 120px;
    border: 3px solid var(--text-primary);
    border-radius: 50%;
    background-color: var(--primary-bg);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--danger-color);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.compass-directions {
    position: absolute;
    width: 100%;
    height: 100%;
}

.compass-n, .compass-e, .compass-s, .compass-w {
    position: absolute;
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.compass-n { top: 5px; left: 50%; transform: translateX(-50%); }
.compass-e { right: 8px; top: 50%; transform: translateY(-50%); }
.compass-s { bottom: 5px; left: 50%; transform: translateX(-50%); }
.compass-w { left: 8px; top: 50%; transform: translateY(-50%); }

.bearing-info {
    display: flex;
    gap: 2rem;
    flex: 1;
    justify-content: space-around;
}

.bearing-display, .distance-display, .heading-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bearing-label, .distance-label, .heading-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.bearing-value, .distance-value, .heading-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.bearing-value {
    color: var(--warning-color);
}

.distance-value {
    color: var(--success-color);
}

.heading-value {
    color: var(--accent-bg);
}

.committee-bearing-display {
    background-color: var(--primary-bg);
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    margin-left: 1rem;
    min-width: 180px;
}

.committee-bearing-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.committee-bearing-values {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.committee-bearing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.committee-bearing-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.committee-bearing-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
    font-family: 'Courier New', monospace;
}

.committee-distance-value {
    color: var(--warning-color);
}

.map-section {
    flex: 2; /* Increased from 1 to 2 for more map space */
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children */
}

#navigation-map {
    flex: 1;
    height: 100%;
    min-height: 400px; /* Increased from 300px to 400px */
    width: 100%;
}

.navigation-controls {
    background-color: var(--secondary-bg);
    padding: 0.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid var(--border-color);
}

.nav-control-btn {
    padding: 0.5rem 1rem;
    background-color: var(--accent-bg);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nav-control-btn:hover {
    background-color: #3b82f6;
}

.nav-control-btn.danger {
    background-color: var(--danger-color);
}

.nav-control-btn.danger:hover {
    background-color: #dc2626;
}

/* GPS Error Message Styles */
.gps-error-message {
    background-color: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem;
    border: 2px solid #dc2626;
}

.gps-error-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.gps-error-content p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.gps-error-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.retry-gps-btn, .manual-location-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.retry-gps-btn {
    background-color: #10b981;
    color: white;
}

.retry-gps-btn:hover {
    background-color: #059669;
}

.manual-location-btn {
    background-color: #f59e0b;
    color: white;
}

.manual-location-btn:hover {
    background-color: #d97706;
}


.location-status-notification {
    animation: slideInFromRight 0.3s ease-out;
}

/* Course List Styles */
.course-list-screen {
    min-height: 100vh;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    padding: 1rem;
}

.header-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}


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

.new-btn:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.courses-container {
    position: relative;
    min-height: 400px;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.courses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.course-card {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.course-card:hover {
    border-color: var(--accent-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.course-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.course-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
}

.course-actions {
    display: flex;
    gap: 0.5rem;
}

.course-action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-course-btn {
    background-color: var(--accent-bg);
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-course-btn:hover {
    background-color: #3b82f6;
}

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

.delete-course-btn:hover {
    background-color: #dc2626;
}

.course-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.course-detail {
    display: flex;
    flex-direction: column;
}

.course-detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.course-detail-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-primary);
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.marks-count {
    font-weight: bold;
    color: var(--accent-bg);
}

.no-courses-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-courses-message h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-courses-message p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.create-first-btn {
    background-color: var(--accent-bg);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.create-first-btn:hover {
    background-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
    opacity: 0.5;
}

.error-message h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
}

.error-message p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

.retry-btn {
    background-color: var(--warning-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background-color: #d97706;
}

/* Delete confirmation modal */
.delete-confirmation-dialog {
    background-color: var(--secondary-bg);
    border: 2px solid var(--danger-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    color: white;
    animation: dialogSlideIn 0.2s ease-out;
}

.delete-confirmation-dialog h3 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--danger-color);
    text-align: center;
}

.delete-confirmation-dialog p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-primary);
    text-align: center;
}

.warning-text {
    color: var(--warning-color) !important;
    font-weight: bold;
    font-size: 0.9rem !important;
}

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

.delete-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Mobile responsiveness for course setting */
@media (max-width: 768px) {
    .course-setting {
        height: 100vh;
        overflow-y: auto;
    }

    .controls-panel {
        border-bottom: 3px solid #ced4da;
    }

    .controls-panel.expanded {
        max-height: 70vh;
    }

    .controls-panel:not(.expanded) {
        max-height: 75px;
    }

    .panel-header {
        padding: 1rem;
        min-height: 75px;
    }

    .header-left {
        gap: 0.5rem;
    }

    .back-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.9rem;
        border-radius: 6px;
    }

    .course-title {
        font-size: 1rem;
    }

    .panel-toggle-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
        gap: 0.4rem;
    }

    .panel-content {
        padding: 1rem;
    }

    .course-inputs {
        margin-bottom: 1.25rem;
        padding: 1rem;
        border-radius: 8px;
    }

    .input-row {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        align-items: stretch;
    }

    .input-group {
        min-width: auto;
        width: 100%;
        flex: none;
    }

    .input-group.wide,
    .input-group.wind-group {
        flex: none;
        min-width: auto;
    }

    .input-group label {
        font-size: 0.9rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        color: var(--dark-gray);
    }

    .input-group input,
    .input-group select {
        height: 50px;
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 8px;
        border-width: 2px;
        font-weight: 500;
    }

    .input-group select {
        background-size: 18px;
        background-position: right 1rem center;
        padding-right: 3rem;
    }

    .input-with-button {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .get-wind-btn {
        height: 50px;
        font-size: 1rem;
        padding: 0.875rem 1rem;
        width: 100%;
        min-width: auto;
        border-radius: 8px;
    }

    .course-controls {
        gap: 1.25rem;
        padding: 1rem;
        border-radius: 8px;
    }

    .toggles-section {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
        background: #f1f3f5;
        border-radius: 6px;
    }

    .toggle-group {
        padding: 0.875rem 1rem;
        border-radius: 6px;
        margin: 0;
    }

    .toggle-group:hover {
        border-color: var(--secondary-green);
    }

    .toggle-label {
        justify-content: space-between;
        width: 100%;
        font-size: 0.9rem;
        font-weight: 700;
    }

    .toggle-text {
        font-weight: 700;
        color: var(--dark-gray);
    }

    .toggle {
        width: 54px;
        height: 30px;
        flex-shrink: 0;
    }

    .slider {
        border-radius: 30px;
    }

    .slider:before {
        height: 22px;
        width: 22px;
        left: 4px;
        bottom: 4px;
    }

    input:checked + .slider:before {
        transform: translateX(24px);
    }

    .buttons-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        align-items: stretch;
    }

    .control-btn {
        padding: 0.875rem;
        font-size: 0.85rem;
        height: 52px;
        border-radius: 6px;
        font-weight: 700;
        min-height: 52px;
    }

    .control-btn.primary {
        grid-column: span 2;
        font-size: 1rem;
        font-weight: 700;
        height: 56px;
    }

    #map {
        min-height: 400px;
        flex: 1;
    }

    .wind-indicator {
        left: 15px;
        top: 65%;
        transform: translateY(-50%);
        padding: 0.75rem;
        width: 55px;
        height: 55px;
    }

    .wind-arrow {
        font-size: 1.4rem;
    }

    .quick-action-bar {
        padding: 0.5rem 1rem;
        gap: 1rem;
    }

    .quick-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        border-radius: 6px;
    }

    .quick-course-info {
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
    }

    .boat-info {
        font-size: 0.8rem;
    }

    .course-info {
        font-size: 0.7rem;
    }
}

/* Mobile responsiveness for course list */
@media (max-width: 768px) {
    .course-list-screen {
        padding: 0.75rem;
        min-height: 100vh;
    }

    .header-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 1.5rem;
        gap: 1.5rem;
    }

    .page-title {
        font-size: 2rem;
        margin: 0;
    }

    .action-buttons {
        flex-direction: row;
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }

    .action-btn {
        flex: 1;
        max-width: 200px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        text-align: center;
        justify-content: center;
        min-height: 56px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .new-btn {
        background: linear-gradient(135deg, var(--success-color), #059669);
    }

    .new-btn:hover {
        background: linear-gradient(135deg, #059669, #047857);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    }

    .courses-container {
        min-height: auto;
    }

    .courses-list {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }

    .course-card {
        padding: 1.25rem;
        border-radius: 16px;
        border-width: 2px;
        transition: all 0.3s ease;
        margin-bottom: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .course-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        border-color: var(--accent-bg);
    }

    .course-card-header {
        margin-bottom: 1.25rem;
        align-items: center;
        gap: 1rem;
    }

    .course-name {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        text-align: left;
    }

    .course-actions {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .course-action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
        font-weight: bold;
        min-height: 40px;
        min-width: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .view-course-btn:hover {
        background-color: #2563eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    }

    .delete-course-btn:hover {
        background-color: #dc2626;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    }

    .course-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .course-detail {
        background-color: var(--primary-bg);
        padding: 0.75rem;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        transition: background-color 0.2s ease;
    }

    .course-detail:hover {
        background-color: rgba(37, 99, 235, 0.1);
    }

    .course-detail-label {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .course-detail-value {
        font-size: 1rem;
        font-weight: bold;
        line-height: 1.2;
    }

    .course-meta {
        padding-top: 1rem;
        font-size: 0.85rem;
        border-top: 2px solid var(--border-color);
    }

    .marks-count {
        font-size: 0.9rem;
        font-weight: bold;
        color: var(--success-color);
    }

    /* Empty states */
    .no-courses-message {
        padding: 2rem 1rem;
        text-align: center;
    }

    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }

    .no-courses-message h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .no-courses-message p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .create-first-btn {
        width: 100%;
        max-width: 300px;
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--accent-bg), #3b82f6);
    }

    .create-first-btn:hover {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
    }

    /* Error states */
    .error-message {
        padding: 2rem 1rem;
    }

    .error-icon {
        font-size: 3rem;
    }

    .error-message h2 {
        font-size: 1.5rem;
    }

    .error-message p {
        font-size: 1rem;
    }

    .retry-btn {
        width: 100%;
        max-width: 250px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    /* Loading indicator */
    .loading-indicator {
        padding: 2rem 1rem;
    }

    .spinner {
        width: 48px;
        height: 48px;
        border-width: 4px;
    }
}

/* Tablet responsiveness for course setting */
@media (max-width: 1024px) and (min-width: 769px) {
    .controls-panel {
        padding: 1rem;
        gap: 1rem;
    }

    .course-inputs {
        gap: 0.75rem;
    }

    .input-group {
        min-width: 140px;
    }

    .input-group input,
    .input-group select {
        height: 44px;
        font-size: 0.95rem;
    }

    .toggles-section {
        gap: 1rem;
    }

    .buttons-section {
        gap: 0.75rem;
    }

    .control-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

/* Tablet responsiveness for course list */
@media (max-width: 1024px) and (min-width: 769px) {
    .course-list-screen {
        padding: 1rem;
    }

    .header-section {
        gap: 1.5rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .action-btn {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

    .courses-list {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.25rem;
    }

    .course-card {
        padding: 1.25rem;
    }

    .course-name {
        font-size: 1.3rem;
    }

    .course-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.625rem;
    }

    .course-action-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Small mobile devices (phones in portrait) */
@media (max-width: 480px) {
    .course-list-screen {
        padding: 0.5rem;
        font-size: 14px;
    }

    .header-section {
        margin-bottom: 1rem;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .action-btn {
        width: 100%;
        max-width: none;
        padding: 1.125rem 1.5rem;
        font-size: 1rem;
        min-height: 52px;
    }

    .courses-list {
        gap: 0.875rem;
    }

    .course-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .course-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .course-name {
        font-size: 1.25rem;
        width: 100%;
        text-align: left;
        margin-bottom: 0;
    }

    .course-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .course-action-btn {
        flex: 1;
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
        min-height: 44px;
        border-radius: 6px;
    }

    .course-details {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .course-detail {
        padding: 0.625rem;
    }

    .course-detail-label {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }

    .course-detail-value {
        font-size: 0.95rem;
    }

    .course-meta {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .marks-count {
        font-size: 0.85rem;
    }

    /* Small screen empty/error states */
    .no-courses-message,
    .error-message {
        padding: 1.5rem 0.75rem;
    }

    .empty-state-icon,
    .error-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .no-courses-message h2,
    .error-message h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .no-courses-message p,
    .error-message p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .create-first-btn,
    .retry-btn {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    .loading-indicator {
        padding: 1.5rem 0.75rem;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }
}

/* Small mobile devices (phones in portrait) */
@media (max-width: 480px) {
    .course-setting {
        font-size: 14px;
    }

    .controls-panel {
        padding: 0.75rem 0.25rem;
    }

    .back-btn {
        font-size: 0.9rem;
        padding: 0.625rem 0.75rem;
    }

    .input-group label {
        font-size: 0.95rem;
    }

    .input-group input,
    .input-group select {
        height: 44px;
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .get-wind-btn {
        height: 44px;
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .toggle-text {
        font-size: 1rem;
    }

    .control-btn {
        padding: 0.875rem;
        font-size: 0.9rem;
        height: 52px;
        min-height: 52px;
    }

    #generate-course {
        height: 60px;
        font-size: 1rem;
    }

    .buttons-section {
        gap: 0.75rem;
    }

    .wind-indicator {
        padding: 0.5rem;
        left: 5px;
    }

    .wind-arrow {
        font-size: 1.25rem;
    }
}

/* Mobile responsiveness for navigation */
@media (max-width: 768px) {
    .mark-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .compass-display {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .compass-rose {
        width: 100px;
        height: 100px;
    }

    .compass-needle {
        font-size: 1.5rem;
    }

    .bearing-info {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .bearing-display, .distance-display, .heading-display, .committee-bearing-display {
        width: 100%;
        max-width: 300px;
    }

    .committee-bearing-display {
        min-width: auto;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .bearing-value, .distance-value, .heading-value {
        font-size: 1.5rem;
    }

    .committee-bearing-value {
        font-size: 1rem;
    }

    .navigation-controls {
        flex-direction: column;
    }

    .nav-control-btn {
        width: 100%;
    }

    .gps-error-actions {
        flex-direction: column;
    }

    .retry-gps-btn, .manual-location-btn {
        width: 100%;
    }

    .location-status-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    /* Make navigation map even taller on mobile */
    #navigation-map {
        min-height: 350px;
    }
}

/* View Course Styles */
.view-course {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--primary-bg);
    color: var(--text-primary);
}

.view-header {
    background-color: var(--secondary-bg);
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.course-info-display {
    margin: 1rem 0;
}

.course-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    text-align: center;
}

.course-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--primary-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-primary);
}

.view-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* Specific variations for different contexts */
.action-btn.compact {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.action-btn.elevated {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.export-btn {
    background-color: var(--accent-bg);
    color: white;
}

.export-btn:hover {
    background-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.edit-btn {
    background-color: var(--warning-color);
    color: white;
}

.edit-btn:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#view-map {
    flex: 1;
    position: relative;
    min-height: 400px;
}

.course-legend {
    position: fixed;
    top: 120px;
    right: 20px;
    background-color: rgba(30, 41, 59, 0.95);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    max-width: 250px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.course-legend h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: var(--primary-bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.legend-item:hover {
    background-color: var(--accent-bg);
    transform: translateX(2px);
}

.legend-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.legend-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
}

.legend-coords {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.view-marker-popup {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    min-width: 150px;
    text-align: center;
}

.view-marker-popup .coordinates {
    color: #666;
    font-size: 11px;
    margin: 6px 0 10px 0;
    font-family: 'Courier New', monospace;
}

.view-marker-popup strong {
    color: #1e40af;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Login Screen Styles */
.login-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-bg), var(--secondary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.app-branding {
    margin-bottom: 3rem;
}

.app-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.app-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.app-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.login-card {
    background-color: var(--secondary-bg);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.flash-messages {
    margin-bottom: 2rem;
}

.flash-message {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.flash-message.flash-error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.flash-message.flash-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.flash-icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.google-signin-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.alternative-signin {
    margin-top: 1.5rem;
}

.manual-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.3);
}

.manual-signin-btn:hover {
    background-color: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.4);
}

.google-icon {
    flex-shrink: 0;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}


.error-message h3 {
    color: var(--danger-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.auth-error {
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
}

.security-notice {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.security-icon {
    font-size: 1.1rem;
}

.feature-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature-icon {
    font-size: 1.2rem;
}

/* User Management Styles */
.manage-users-screen {
    min-height: 100vh;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    padding: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.users-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.users-table-container {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.table-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    gap: 1rem;
}

.refresh-btn {
    padding: 0.5rem 1rem;
    background-color: var(--accent-bg);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background-color: #3b82f6;
}

.users-table-wrapper {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background-color: var(--primary-bg);
    color: var(--text-secondary);
    font-weight: bold;
    padding: 1rem;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.user-row {
    transition: background-color 0.2s ease;
}

.user-row:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.user-row.inactive-user {
    opacity: 0.6;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-name {
    font-weight: bold;
    color: var(--text-primary);
}

.current-user-badge {
    background-color: var(--success-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: bold;
    margin-top: 0.25rem;
    display: inline-block;
}

.user-email {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.role-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.role-super {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.role-normal {
    background-color: rgba(107, 114, 128, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-inactive {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.login-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.no-login {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}


.role-btn {
    background-color: var(--warning-color);
    color: white;
}

.role-btn:hover {
    background-color: #d97706;
    transform: translateY(-1px);
}

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

.status-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.protected-user {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: bold;
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification {
    background-color: var(--secondary-bg);
    border: 2px solid;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: slideInFromRight 0.3s ease-out;
}

.notification-success {
    border-color: var(--success-color);
}

.notification-error {
    border-color: var(--danger-color);
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* Main Menu Updates */
.user-welcome {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--secondary-bg);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    z-index: 10;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.welcome-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.role-indicator {
    font-size: 1.1rem;
    title: "Super User";
}

.logout-btn {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-bg);
    background-color: var(--accent-bg);
}

.admin-btn {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    position: relative;
    overflow: hidden;
}

.admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.admin-btn:hover::before {
    left: 100%;
}

/* Mobile responsiveness for authentication */
@media (max-width: 768px) {
    .login-screen {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem;
    }

    .app-title {
        font-size: 2rem;
    }

    .app-icon {
        font-size: 3rem;
    }

    .feature-highlights {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .user-welcome {
        position: static;
        margin-bottom: 2rem;
        width: 100%;
        justify-content: space-between;
    }

    .users-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    .action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .notification {
        min-width: auto;
        margin: 0 1rem;
    }

    .notification-container {
        top: 10px;
        right: 0;
        left: 0;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .users-stats {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .user-welcome {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .user-info {
        justify-content: center;
    }
}

/* iPad Optimizations */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    /* iPad Web App Specific Styles */
    html {
        -webkit-text-size-adjust: 100%;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    body {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    /* Enhanced touch targets for iPad */
    button, .btn, .main-menu-btn, .control-btn, .action-btn {
        min-height: 54px;
        min-width: 54px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Login Screen iPad Optimizations */
    .login-container {
        max-width: 500px;
        transform: scale(1.1);
    }

    .google-login-btn, .simple-login-btn {
        min-height: 58px;
        font-size: 18px;
        border-radius: 12px;
    }

    .form-group input {
        min-height: 54px;
        font-size: 17px;
        border-radius: 10px;
        padding: 16px 20px;
    }

    /* Main Menu iPad Layout */
    .main-menu-screen {
        height: 100vh;
        overflow: hidden;
    }

    .app-header {
        padding: 2rem 3rem;
    }

    .app-title-main {
        font-size: 3.5rem;
    }

    .app-subtitle {
        font-size: 1.4rem;
    }

    .menu-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        max-width: 900px;
    }

    .main-menu-btn {
        min-height: 180px;
        padding: 2rem;
        border-radius: 24px;
        transition: all 0.2s ease;
    }

    .main-menu-btn:hover {
        transform: translateY(-4px) scale(1.05);
        box-shadow: 0 15px 35px rgba(0, 112, 74, 0.25);
    }

    .menu-btn-icon {
        font-size: 4rem;
        margin-bottom: 1rem;
    }

    .menu-btn-text h3 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .menu-btn-text p {
        font-size: 1rem;
        line-height: 1.4;
    }

    /* Course Setting iPad Optimizations */
    .course-setting {
        height: 100vh;
        overflow: hidden;
    }

    .controls-panel {
        padding: 1.5rem;
        min-height: 120px;
    }

    .course-inputs {
        gap: 1.5rem;
    }

    .input-group {
        min-width: 160px;
    }

    .input-group input,
    .input-group select {
        height: 54px;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 12px;
        border-width: 2px;
    }

    .input-group select {
        background-size: 20px;
        background-position: right 16px center;
        padding-right: 48px;
    }

    .get-wind-btn {
        height: 54px;
        padding: 16px 24px;
        font-size: 15px;
        min-width: 140px;
        border-radius: 12px;
    }

    .toggle {
        width: 60px;
        height: 34px;
    }

    .slider:before {
        height: 26px;
        width: 26px;
        left: 4px;
        bottom: 4px;
    }

    input:checked + .slider:before {
        transform: translateX(26px);
    }

    .toggle-text {
        font-size: 1rem;
    }

    .control-btn {
        min-height: 54px;
        padding: 16px 24px;
        font-size: 16px;
        border-radius: 12px;
        font-weight: 600;
    }

    /* Map optimizations for iPad */
    #map, #navigation-map, #view-map {
        height: calc(100vh - 120px);
        min-height: 500px;
    }

    .wind-indicator {
        width: 80px;
        height: 80px;
        padding: 1.25rem;
        left: 24px;
    }

    .wind-arrow {
        font-size: 2.5rem;
    }

    /* Navigation iPad Optimizations */
    .navigate-screen {
        height: 100vh;
        overflow: hidden;
    }

    .mark-selector {
        padding: 1.5rem;
    }

    .mark-dropdown {
        min-height: 54px;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 12px;
    }

    .start-nav-btn {
        min-height: 54px;
        padding: 16px 32px;
        font-size: 16px;
        border-radius: 12px;
    }

    .heading-section {
        padding: 1.5rem;
    }

    .compass-rose {
        width: 140px;
        height: 140px;
        border-width: 4px;
    }

    .compass-needle {
        font-size: 3rem;
    }

    .bearing-value, .distance-value, .heading-value {
        font-size: 2.5rem;
    }

    .committee-bearing-display {
        padding: 1.25rem;
        min-width: 220px;
        border-radius: 12px;
    }

    .committee-bearing-value {
        font-size: 1.4rem;
    }

    #navigation-map {
        min-height: 450px;
    }

    .nav-control-btn {
        min-height: 54px;
        padding: 16px 24px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* Countdown iPad Optimizations */
    .countdown-screen {
        height: 100vh;
        overflow: hidden;
    }

    .countdown-container h1 {
        font-size: 3rem;
        margin-bottom: 2.5rem;
    }

    #timer {
        font-size: 8rem;
        margin-bottom: 2rem;
    }

    .flag-status {
        font-size: 2rem;
        min-height: 4rem;
        border-radius: 12px;
        border-width: 3px;
    }

    .start-btn, .stop-btn, .reset-btn {
        min-height: 64px;
        padding: 20px 40px;
        font-size: 18px;
        border-radius: 12px;
        margin: 0 1rem;
    }

    .toggle-option {
        padding: 16px 24px;
        min-height: 54px;
        font-size: 16px;
        border-radius: 12px;
    }

    .bluetooth-btn, .enable-audio-btn {
        min-height: 54px;
        padding: 16px 24px;
        font-size: 16px;
        border-radius: 12px;
    }

    .sequence-item {
        padding: 12px 20px;
        min-width: 400px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* Course List iPad Optimizations */
    .course-list-screen {
        height: 100vh;
        overflow-y: auto;
        padding: 2rem;
    }

    .page-title {
        font-size: 3rem;
    }

    .action-btn {
        min-height: 58px;
        padding: 18px 32px;
        font-size: 17px;
        border-radius: 12px;
    }

    .courses-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 1rem 0;
    }

    .course-card {
        padding: 2rem;
        border-radius: 16px;
        border-width: 2px;
        min-height: 250px;
    }

    .course-name {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .course-action-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 15px;
        border-radius: 10px;
        font-weight: 600;
    }

    .course-details {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .course-detail {
        padding: 12px 16px;
        border-radius: 10px;
    }

    .course-detail-label {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .course-detail-value {
        font-size: 1.1rem;
    }

    /* User Management iPad Optimizations */
    .manage-users-screen {
        height: 100vh;
        overflow-y: auto;
        padding: 2rem;
    }

    .users-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .stat-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .users-table th,
    .users-table td {
        padding: 16px 20px;
        font-size: 15px;
    }

    .action-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
    }

    .user-avatar {
        width: 50px;
        height: 50px;
    }

    .user-avatar-placeholder {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    /* Modal and Dialog iPad Optimizations */
    .modal-content {
        padding: 2.5rem;
        border-radius: 20px;
        max-width: 600px;
    }

    .mark-creation-dialog,
    .delete-confirmation-dialog {
        padding: 2.5rem;
        border-radius: 20px;
        max-width: 500px;
    }

    .dialog-btn {
        min-height: 54px;
        padding: 16px 32px;
        font-size: 16px;
        border-radius: 12px;
        min-width: 150px;
    }

    /* Form optimizations */
    .form-control {
        min-height: 54px;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 12px;
        border-width: 2px;
    }

    .form-select {
        min-height: 54px;
        padding: 16px 20px;
        padding-right: 50px;
        font-size: 16px;
        background-size: 20px;
        background-position: right 16px center;
    }

    /* View Course iPad Optimizations */
    .view-course {
        height: 100vh;
        overflow: hidden;
    }

    .view-header {
        padding: 1.5rem 2rem;
    }

    .course-title {
        font-size: 2.2rem;
    }

    .course-details-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .detail-item {
        padding: 16px 20px;
        border-radius: 12px;
    }

    .detail-label {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .detail-value {
        font-size: 1.1rem;
    }

    .view-actions {
        gap: 1.5rem;
        margin: 1.5rem 0;
    }

    .export-btn, .edit-btn {
        min-height: 54px;
        padding: 16px 32px;
        font-size: 16px;
        border-radius: 12px;
    }

    #view-map {
        min-height: 450px;
    }

    .course-legend {
        top: 140px;
        right: 24px;
        padding: 1.5rem;
        border-radius: 16px;
        max-width: 300px;
    }

    .legend-item {
        padding: 12px 16px;
        border-radius: 10px;
    }

    .legend-name {
        font-size: 1rem;
    }

    .legend-coords {
        font-size: 0.85rem;
    }

    /* Notification optimizations */
    .notification-container {
        top: 30px;
        right: 30px;
    }

    .notification {
        padding: 1.5rem;
        border-radius: 16px;
        min-width: 350px;
    }

    .flash-message {
        padding: 1.5rem;
        border-radius: 12px;
        font-size: 16px;
    }

    /* Leaflet popup optimizations */
    .leaflet-popup-content-wrapper {
        border-radius: 12px;
        min-width: 200px;
    }

    .leaflet-popup-content {
        margin: 16px 20px;
        font-size: 15px;
    }

    .navigate-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 10px;
    }
}

/* iPad Portrait Specific */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait) {
    .menu-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
        max-width: 700px;
    }

    .courses-list {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }

    .course-card {
        min-height: 200px;
    }

    .users-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iPad Landscape Specific */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape) {
    .course-setting .controls-panel {
        max-height: 140px;
        overflow-y: auto;
    }

    .course-inputs {
        flex-wrap: wrap;
    }

    .input-row {
        display: flex;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    #map, #navigation-map, #view-map {
        height: calc(100vh - 140px);
        min-height: 400px;
    }

    .countdown-container {
        padding: 1rem 2rem;
    }

    #timer {
        font-size: 6rem;
    }

    .navigation-display {
        flex-direction: row;
    }

    .heading-section {
        flex: 0 0 auto;
        width: 400px;
        border-right: 2px solid var(--border-color);
        border-bottom: none;
    }

    .map-section {
        flex: 1;
    }
}

/* High DPI iPad (Retina) */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
    /* Enhance text rendering on Retina displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Sharper borders and shadows */
    .main-menu-btn, .course-card, .stat-card {
        border-width: 1px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* Mobile responsiveness for view course */
@media (max-width: 768px) {
    .course-title {
        font-size: 1.5rem;
    }

    .course-details-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .view-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .course-legend {
        position: static;
        margin: 1rem;
        max-width: none;
        max-height: none;
    }

    .legend-item {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    .legend-coords {
        font-size: 0.8rem;
    }
}

/* ── GPS User Beacon Marker ── */
.user-gps-beacon-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}

.user-gps-beacon-dot {
    width: 14px;
    height: 14px;
    background: #00d4aa;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.95), 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 2;
    position: relative;
    margin: auto;
}

.user-gps-beacon-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    margin-left: -18px;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.45);
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.4);
    animation: user-gps-pulse-anim 2s infinite ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes user-gps-pulse-anim {
    0% {
        transform: scale(0.35);
        opacity: 0.95;
    }
    70% {
        transform: scale(2.2);
        opacity: 0;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}
