/* Race Kalender Styles */
.rk-race-calendar-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.rk-race-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    align-items: center; /* Align items vertically center */
}

.rk-filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    margin: 0; /* Reset group margin */
}

.rk-date-group {
    flex: 1.5;
}

.rk-date-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    height: 42px; /* Match input height */
}

.rk-date-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #666;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#rk-date-range-picker {
    padding-left: 45px !important;
    cursor: pointer;
}

.rk-race-filters input[type="text"],
.rk-race-filters select {
    padding: 0 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    width: 100% !important;
    font-size: 14px !important;
    height: 42px !important;
    min-height: 42px !important; /* Force min-height */
    max-height: 42px !important; /* Force max-height */
    line-height: normal !important; /* Reset line-height */
    margin: 0 !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    display: block !important;
    color: #333 !important;
    box-shadow: none !important;
    appearance: none; /* Remove default browser styling */
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Add custom arrow for select since we removed appearance */
.rk-filter-group select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
    padding-right: 30px !important; /* Make space for arrow */
}

.rk-race-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.rk-race-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rk-race-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.rk-card-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.rk-card-image-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
}

.rk-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rk-race-card:hover .rk-card-image-wrapper img {
    transform: scale(1.05);
}

.rk-card-date-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 50px;
}

.rk-date-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #333;
}

.rk-date-month {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

.rk-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.rk-card-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.rk-card-title a {
    text-decoration: none;
    color: #333;
    border-bottom: 2px solid #ff0000; /* Red underline like example */
    padding-bottom: 2px;
    transition: color 0.2s;
}

.rk-card-title a:hover {
    color: #000;
    border-bottom-color: #cc0000;
}

.rk-card-meta {
    margin-bottom: 20px;
    color: #555;
    font-size: 15px;
}

.rk-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rk-meta-row i {
    color: #777;
    font-size: 16px;
}

.rk-card-footer {
    margin-top: auto;
}

.rk-class-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .rk-race-list {
        grid-template-columns: 1fr;
    }
}

/* Single Event Styles */
.rk-race-single-image {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rk-race-single-image img {
    width: 100%;
    height: auto;
    display: block;
}

.rk-race-single-details {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.rk-race-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.rk-race-meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rk-meta-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rk-meta-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Page Title */
.rk-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 0;
    line-height: 1.2;
}

/* Hide theme's default page title when calendar is present */
.rk-race-calendar-wrapper ~ .entry-title,
.page .entry-header .entry-title,
.page .page-header .page-title,
.entry-header h1,
.page-header h1,
article header h1,
.post-title,
.entry-content > h1:first-child {
    display: none !important;
}

/* Also hide on home */
.home .entry-title,
.home .page-title,
.home .post-title {
    display: none !important;
}

/* Calendar Header */
.rk-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Header Controls Group */
.rk-header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.rk-subscribe-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.rk-subscribe-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.rk-subscribe-button .dashicons {
    font-size: 18px;
}

/* Timezone Switcher */
.rk-timezone-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rk-timezone-switcher label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #50575e;
    margin: 0;
}

.rk-timezone-switcher .dashicons {
    font-size: 18px;
}

.rk-timezone-switcher select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rk-calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rk-page-title {
        font-size: 24px;
    }

    .rk-header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .rk-timezone-label-text {
        display: none;
    }
}

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

.rk-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 40px;
    border-radius: 16px;
    max-width: 700px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rk-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.rk-modal-close:hover {
    color: #333;
}

.rk-modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.rk-modal-intro {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Subscribe Options */
.rk-subscribe-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.rk-subscribe-option label {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.rk-subscribe-option label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.rk-subscribe-option input[type="radio"] {
    margin-right: 8px;
}

.rk-subscribe-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.rk-subscribe-option label:has(input:checked) {
    border-color: #667eea;
    background: #f8f9ff;
}

/* Calendar URL Section */
.rk-calendar-url-section {
    margin-bottom: 30px;
}

.rk-calendar-url-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.rk-url-input-group {
    display: flex;
    gap: 10px;
}

.rk-url-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #f9f9f9;
}

.rk-copy-btn {
    padding: 12px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.rk-copy-btn:hover {
    background: #5568d3;
}

.rk-copy-feedback {
    display: none;
    margin-top: 8px;
    font-size: 14px;
}

/* Platform Instructions */
.rk-platform-instructions h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.rk-platform-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.rk-tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rk-tab-btn:hover {
    color: #333;
}

.rk-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.rk-platform-icon {
    font-size: 20px;
}

.rk-platform-content {
    position: relative;
    min-height: 280px;
}

.rk-platform-panel {
    display: none;
}

.rk-platform-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.rk-platform-panel ol {
    padding-left: 20px;
    line-height: 1.8;
}

.rk-platform-panel li {
    margin-bottom: 12px;
    color: #555;
}

.rk-platform-panel strong {
    color: #333;
}

.rk-platform-panel a {
    color: #667eea;
    text-decoration: none;
}

.rk-platform-panel a:hover {
    text-decoration: underline;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .rk-modal-content {
        margin: 10px;
        padding: 25px 20px;
        max-width: 95%;
        width: 95%; /* Ensure width is set */
        box-sizing: border-box; /* Include padding in width */
        max-height: 90vh; /* Prevent overflowing screen height */
        overflow-y: auto; /* Allow scrolling if content is too long */
    }
    
    .rk-calendar-header {
        justify-content: center;
    }
    
    .rk-subscribe-button {
        width: 100%;
        justify-content: center;
    }
    
    .rk-url-input-group {
        flex-direction: column;
    }
    
    .rk-platform-tabs {
        flex-wrap: wrap;
    }
    
    .rk-tab-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
}

/* Load More Button */
.rk-load-more-container {
    margin: 30px 0;
    text-align: center;
}

.rk-load-more-btn {
    background-color: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

.rk-load-more-btn:hover {
    background-color: #fff;
    border-color: #2271b1;
    color: #2271b1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rk-load-more-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.rk-load-more-btn.updating-message {
    opacity: 0.7;
    cursor: wait;
}

/* Timezone Switcher */
.rk-timezone-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.rk-timezone-switcher label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin: 0;
}

.rk-timezone-switcher .dashicons {
    font-size: 18px;
    color: #667eea;
}

#rk-timezone-select {
    padding: 8px 30px 8px 12px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    background-color: #fff !important;
    cursor: pointer;
    transition: border-color 0.2s;
}

#rk-timezone-select:hover {
    border-color: #667eea !important;
}

#rk-timezone-select:focus {
    outline: none;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Timezone Badge */
.rk-timezone-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    text-transform: uppercase;
}

/* Responsive Timezone Switcher */
@media (max-width: 768px) {
    .rk-calendar-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .rk-timezone-switcher {
        margin-right: 0;
        justify-content: center;
    }
    
    #rk-timezone-select {
        flex: 1;
    }
}

/* ============================================
   Countdown Widget Styles
   ============================================ */

.rk-countdown-widget {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rk-countdown-widget .widget-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.rk-countdown-class-filter {
    padding: 15px 20px 0 20px;
}

.rk-countdown-class-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.rk-countdown-class-select:hover {
    border-color: #667eea;
}

.rk-countdown-class-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rk-countdown-container {
    padding: 20px;
}

.rk-countdown-image {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.rk-countdown-image img {
    width: 100%;
    height: auto;
    display: block;
}

.rk-countdown-event-info {
    margin-bottom: 20px;
}

.rk-countdown-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.rk-countdown-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #50575e;
}

.rk-countdown-class {
    display: inline-block;
    background: #f0f0f1;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    color: #1d2327;
    width: fit-content;
}

.rk-countdown-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rk-countdown-location .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.rk-countdown-timer {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 15px !important;
    border-radius: 6px !important;
}

.rk-countdown-unit {
    text-align: center !important;
    color: white !important;
}

.rk-countdown-value {
    display: block !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin-bottom: 5px !important;
    color: white !important;
}

.rk-countdown-label {
    display: block !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    opacity: 0.9 !important;
    font-weight: 600 !important;
    color: white !important;
}

.rk-countdown-started {
    text-align: center;
    padding: 15px;
    background: #00a32a;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rk-countdown-started .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.rk-countdown-no-events {
    text-align: center;
    padding: 20px;
    color: #50575e;
    font-style: italic;
}

/* Responsive adjustments for countdown */
@media (max-width: 480px) {
    .rk-countdown-value {
        font-size: 20px;
    }

    .rk-countdown-label {
        font-size: 10px;
    }

    .rk-countdown-timer {
        gap: 8px;
        padding: 12px;
    }
}
