/* ===========================
   Sailing Protest Time Limits - V2 Design System
   =========================== */

/* External Link Button */
.v2-section-header .external-link-btn {
    float: right;
    margin-top: -5px;
}

/* RTL Support for External Link */
html[lang="he"] .v2-section-header .external-link-btn,
[dir="rtl"] .v2-section-header .external-link-btn {
    float: left;
}

/* Container Styles */
.protest-v2-container {
    background: var(--body-container);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Header Styles */
.protest-v2-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.protest-v2-union-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.protest-v2-union-logo img {
    max-width: 100%;
    max-height: 100%;
}

.protest-v2-header h2 {
    font-size: 24px;
    margin: 10px 0;
    font-weight: 600;
}

.protest-v2-header p {
    margin: 5px 0;
    opacity: 0.95;
}

/* Content Styles */
.protest-v2-content {
    padding: 30px;
}

.protest-v2-page-title {
    font-size: 22px;
    color: var(--header-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Current Time Display */
.protest-v2-current-time {
    background: var(--textfield-dark);
    border: 1px solid var(--textfield-dark-border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
    color: var(--textfield-dark-color);
}

/* Action Buttons */
.protest-v2-action-buttons {
    display: flex;
    gap: 15px;
    margin: 25px 0 35px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.protest-v2-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: inline-block;
}

.protest-v2-btn-primary {
    background: #EB5E01;
    color: white;
}

.protest-v2-btn-primary:hover {
    background: var(--primary-hovered-button);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 94, 1, 0.3);
    color: white;
    text-decoration: none;
}

.protest-v2-btn-outline {
    background: var(--black-button);
    color: var(--heebo-color);
    border: 1px solid var(--black-button-borders);
}

.protest-v2-btn-outline:hover {
    background: var(--black-button-hover);
    border-color: var(--black-button-hover-borders);
    color: var(--black-button-hover-color);
    text-decoration: none;
}

/* Day Section Styles */
.protest-v2-day-section {
    margin-bottom: 30px;
    border: 1px solid var(--underline);
    border-radius: 8px;
    overflow: hidden;
    background: var(--body-container);
}

.protest-v2-day-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 16px;
}

/* Table Styles */
.protest-v2-table {
    width: 100%;
    border-collapse: collapse;
}

.protest-v2-table th {
    background: var(--textfield-dark);
    padding: 12px 15px;
    font-weight: 600;
    color: var(--textfield-dark-color);
    border-bottom: 1px solid var(--underline);
    font-size: 14px;
}

.protest-v2-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--underline);
    font-size: 14px;
    color: var(--table-text-color);
}

.protest-v2-table tr:hover {
    background: var(--textfield-dark);
}

.protest-v2-table tr:last-child td {
    border-bottom: none;
}

/* Class Name with Color Badge */
.protest-v2-class-name {
    font-weight: 600;
    color: var(--table-text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.protest-v2-group-color-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--underline);
    flex-shrink: 0;
}

/* Time Display */
.protest-v2-final-time {
    font-weight: 600;
    color: var(--table-text-color);
}

/* Time Remaining Countdown */
.protest-v2-time-remaining {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    min-width: 100px;
    display: inline-block;
    width: 100%;
}

.protest-v2-time-remaining.expired {
    background: #fee2e2;
    color: #dc2626;
}

.protest-v2-time-remaining.critical {
    background: #fef3c7;
    color: #d97706;
    animation: pulse 2s infinite;
}

.protest-v2-time-remaining.warning {
    background: #fef3c7;
    color: #d97706;
}

.protest-v2-time-remaining.safe {
    background: #d1fae5;
    color: #059669;
}

.protest-v2-time-remaining.far {
    background: #dbeafe;
    color: #1e40af;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* No Data Message */
.protest-v2-no-races {
    text-align: center;
    color: var(--info-box-item-text);
    padding: 40px;
    font-style: italic;
}

/* Footer Note */
.protest-v2-footer-note {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 15px;
    margin-top: 25px;
    font-size: 13px;
    color: #92400e;
}

/* Dark Mode Specific Adjustments */
body.dark-mode .protest-v2-footer-note {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

body.dark-mode .protest-v2-time-remaining.expired {
    background: rgba(220, 38, 38, 0.15);
    color: #ef4444;
}

body.dark-mode .protest-v2-time-remaining.critical {
    background: rgba(217, 119, 6, 0.15);
    color: #f59e0b;
}

body.dark-mode .protest-v2-time-remaining.warning {
    background: rgba(217, 119, 6, 0.15);
    color: #f59e0b;
}

body.dark-mode .protest-v2-time-remaining.safe {
    background: rgba(5, 150, 105, 0.15);
    color: #10b981;
}

body.dark-mode .protest-v2-time-remaining.far {
    background: rgba(30, 64, 175, 0.15);
    color: #3b82f6;
}

/* RTL Support */
[dir="rtl"] .protest-v2-class-name {
    flex-direction: row-reverse;
}

[dir="rtl"] .protest-v2-table th,
[dir="rtl"] .protest-v2-table td {
    text-align: right;
}

[dir="ltr"] .protest-v2-table th,
[dir="ltr"] .protest-v2-table td {
    text-align: left;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .protest-v2-header {
        padding: 20px;
    }
    
    .protest-v2-content {
        padding: 20px;
    }
    
    .protest-v2-union-logo {
        width: 60px;
        height: 60px;
    }
    
    .protest-v2-action-buttons {
        flex-direction: column;
    }
    
    .protest-v2-btn {
        width: 100%;
    }
    
    .protest-v2-table {
        font-size: 12px;
    }
    
    .protest-v2-table th,
    .protest-v2-table td {
        padding: 8px 10px;
    }
    
    .protest-v2-time-remaining {
        min-width: 80px;
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .protest-v2-group-color-badge {
        width: 16px;
        height: 16px;
    }
    
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .protest-v2-header h2 {
        font-size: 18px;
    }
    
    .protest-v2-page-title {
        font-size: 18px;
    }
    
    .protest-v2-day-header {
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* Admin Management Styles (for _ProtestTimeLimits.cshtml) */
.protest-time-table {
    padding: 0;
    margin: 0;
}

.protest-time-table .date-header-row td {
    background-color: var(--textfield-dark);
    font-weight: 600;
    padding: 12px;
    font-size: 14px;
    color: var(--textfield-dark-color);
    border-bottom: 2px solid var(--underline);
}

.protest-time-table table {
    width: 100%;
    margin-bottom: 0;
}

.protest-time-table table th {
    font-weight: 600;
    color: var(--table-text-color);
    border-bottom: 2px solid var(--underline);
    padding: 10px;
}

.protest-time-table table td {
    padding: 10px;
    vertical-align: middle;
    color: var(--table-text-color);
}

.countdown-timer {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.countdown-timer.positive { 
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.countdown-timer.negative { 
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Dark mode adjustments for admin */
body.dark-mode .countdown-timer.positive { 
    color: #10b981;
    background-color: rgba(5, 150, 105, 0.15);
    border: 1px solid rgba(5, 150, 105, 0.3);
}

body.dark-mode .countdown-timer.negative { 
    color: #ef4444;
    background-color: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.fixed-cols {
    table-layout: fixed;
    width: 100%;
}

.v2-row.section-padding {
    padding: 15px 15px;
}

.v2-subheader {
    font-size: 16px;
    font-weight: 600;
    color: var(--header-color);
    display: block;
    margin-bottom: 15px;
}

/* ===========================
   Select2 Styles for Sailing Forms
   =========================== */

/* Select2 custom styling to match form design */
.select2-container--default .select2-selection--single {
    height: 48px !important;
    padding: 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    background: white !important;
    line-height: 1.5 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333 !important;
    padding-left: 0 !important;
    padding-right: 30px !important;
    line-height: 24px !important;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 30px !important;
    padding-right: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 10px !important;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 10px !important;
    right: auto !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.select2-dropdown {
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
}

.select2-search--dropdown .select2-search__field {
    padding: 8px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    font-size: 14px !important;
}

.select2-search--dropdown .select2-search__field::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
    font-style: italic;
}

.select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
}

.select2-results__option--highlighted {
    background: #3b82f6 !important;
}

.select2-container {
    width: 100% !important;
}

/* Mobile Select2 adjustments */
@media (max-width: 480px) {
    .select2-container--default .select2-selection--single {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}