/* DEC-Wettkampfkalender Styles */
/* Version 2.1 */

/* Allgemeine Styles */
.decwk-controls {
    margin-bottom: 20px;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.decwk-control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.decwk-filter-form {
    width: 100%;
}

/* Buttons */
.decwk-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.decwk-btn:hover {
    background: #005177;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.decwk-btn.active {
    background: #005177;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.decwk-back-btn {
    background: #666;
}

.decwk-back-btn:hover {
    background: #444;
}

.decwk-ics-btn {
    background: #28a745;
}

.decwk-ics-btn:hover {
    background: #218838;
}

/* View Switcher */
.decwk-view-switcher {
    display: flex;
    gap: 10px;
}

/* Calendar View Styles */
.decwk-calendar-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.decwk-month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.decwk-nav-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.decwk-nav-btn:hover {
    background: #e0e0e0;
    transform: translateX(0);
}

#decwk-prev-month:hover {
    transform: translateX(-3px);
}

#decwk-next-month:hover {
    transform: translateX(3px);
}

#decwk-current-month {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Calendar Grid */
.decwk-calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 5px;
}

.decwk-calendar-table th {
    background: #0073aa;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.decwk-calendar-table td {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
    min-height: 120px;
    height: auto;
    position: relative;
    transition: all 0.3s ease;
}

.decwk-calendar-table td:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.decwk-day-number {
    font-weight: bold;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.decwk-day-with-event {
    background: #e8f4fd !important;
    border-color: #0073aa !important;
}

.decwk-day-with-event:hover {
    background: #d4ebfc !important;
}

.decwk-day-empty {
    background: #fafafa !important;
    border-color: #eee !important;
}

.decwk-day-events {
    font-size: 11px;
    max-height: 100px;
    overflow-y: auto;
}

.decwk-event-link {
    display: block;
    color: #0073aa;
    text-decoration: none;
    padding: 3px 5px;
    margin: 2px 0;
    background: white;
    border-radius: 3px;
    line-height: 1.4;
    transition: all 0.3s ease;
    word-break: break-word;
}

.decwk-event-link:hover {
    background: #0073aa;
    color: white;
    text-decoration: none;
}

.decwk-event-title {
    display: block;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
}

.decwk-today {
    background: #fffacd !important;
    border: 2px solid #ff6600 !important;
    font-weight: bold;
}

/* Table View Styles */
.decwk-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.decwk-table thead {
    background: #0073aa;
    color: white;
}

.decwk-table th {
    padding: 12px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.decwk-table th:hover {
    background: #005177;
}

.decwk-table th.asc::after {
    content: " ↑";
    position: absolute;
    right: 5px;
}

.decwk-table th.desc::after {
    content: " ↓";
    position: absolute;
    right: 5px;
}

.decwk-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
    transition: background 0.3s ease;
}

.decwk-table tr:hover td {
    background: #f5f5f5;
}

.decwk-table td.decwk-date {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
	text-align: left;
}

.decwk-table td.decwk-time {
    color: #0073aa;
    font-weight: 600;
	width: 108px;
}

.decwk-wk-link {
    font-weight: bold;
    color: #ff6600;
    text-decoration: none;
    transition: all 0.3s ease;
	text-align: left;
}

.decwk-wk-link:hover {
    color: #cc5200;
    text-decoration: none;
    transform: scale(1.05);
    display: inline-block;
}

/* PDF Icon Styles */
.decwk-pdf-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.decwk-pdf-link {
    text-decoration: none;
    display: inline-block;
}

.decwk-pdf-link:hover {
    text-decoration: none;
}

.decwk-pdf-link:hover .decwk-pdf-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.decwk-pdf-icon-small {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

.decwk-pdf-list {
    list-style: none;
    padding-left: 0;
}

.decwk-pdf-list li {
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.decwk-pdf-list a {
    color: #0073aa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.decwk-pdf-list a:hover {
    color: #005177;
    text-decoration: none;
    transform: translateX(5px);
    display: inline-block;
}

.decwk-pdf-disabled {
    color: #999;
    font-style: italic;
}

/* ICS Link Styles */
.decwk-ics-link {
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
}

.decwk-ics-link:hover {
    text-decoration: none;
    transform: scale(1.3) rotate(15deg);
    display: inline-block;
}

/* Single Page Details */
.decwk-single-details {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.decwk-single-details h3 {
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-top: 25px;
    margin-bottom: 15px;
}

.decwk-single-details p {
    margin: 15px 0;
}

.decwk-single-details ul {
    margin: 10px 0;
}

.decwk-single-details strong {
    color: #333;
}

.decwk-single-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.decwk-single-table thead th {
    background: #0073aa;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.decwk-single-table tbody td {
    padding: 12px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.decwk-single-table tbody tr:hover {
    background: #f5f5f5;
}

.decwk-distance-badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.decwk-distance-badge.decwk-men {
    background: #1976d2;
    color: white;
}

.decwk-distance-badge.decwk-women {
    background: #c2185b;
    color: white;
}

.decwk-ics-download-single {
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .decwk-control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .decwk-view-switcher {
        width: 100%;
        justify-content: center;
        margin: 10px 0;
    }
    
    .decwk-calendar-table {
        font-size: 11px;
    }
    
    .decwk-calendar-table td {
        min-height: 80px;
        padding: 4px;
    }
    
    .decwk-day-number {
        font-size: 12px;
    }
    
    .decwk-event-link {
        font-size: 10px;
        padding: 2px 3px;
    }
    
    .decwk-month-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    #decwk-current-month {
        font-size: 18px;
        width: 100%;
        text-align: center;
        order: -1;
    }
    
    .decwk-table {
        font-size: 12px;
    }
    
    .decwk-table td, .decwk-table th {
        padding: 6px;
    }
    
    .decwk-single-table {
        font-size: 12px;
    }
    
    .decwk-distance-badge {
        font-size: 10px;
        padding: 2px 5px;
    }
    
    #decwk-search {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .decwk-calendar-table th {
        padding: 5px;
        font-size: 10px;
    }
    
    .decwk-nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .decwk-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .decwk-event-title {
        font-size: 9px;
    }
    
    .decwk-table-wrapper {
        margin: 0 -15px;
    }
    
    .decwk-today-btn {
        display: none;
    }
}

/* Backend Styles */
.widefat .decwk-today-row {
    background-color: #fffacd !important;
}

.today-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Loading State */
.decwk-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.decwk-loading::after {
    content: "Lädt...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-weight: bold;
    z-index: 1000;
}

/* Print Styles */
@media print {
    .decwk-controls,
    .decwk-nav-btn,
    .decwk-back-btn,
    .decwk-view-switcher,
    .decwk-print-btn,
    .decwk-today-btn,
    .decwk-year-select,
    .decwk-quick-jump,
    #decwk-search,
    .decwk-search-wrapper {
        display: none !important;
    }
    
    .decwk-calendar-table {
        border-collapse: collapse;
        page-break-inside: avoid;
    }
    
    .decwk-calendar-table td,
    .decwk-calendar-table th {
        border: 1px solid #000 !important;
        padding: 5px !important;
    }
    
    .decwk-single-table {
        page-break-inside: avoid;
    }
    
    .decwk-event-link {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    body {
        font-size: 10pt !important;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Additional hover effects */
.decwk-btn {
    position: relative;
    overflow: hidden;
}

.decwk-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.decwk-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Accessibility */
.decwk-btn:focus,
.decwk-nav-btn:focus,
.decwk-event-link:focus {
    outline: 2px solid #ff6600;
    outline-offset: 2px;
}

/* Dark mode support (optional) 
@media (prefers-color-scheme: dark) {
    .decwk-calendar-container,
    .decwk-single-details {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .decwk-calendar-table td {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .decwk-day-with-event {
        background: #1a3a52 !important;
    }
    
    .decwk-event-link {
        background: #444;
        color: #4db8ff;
    }
    
    .decwk-event-link:hover {
        background: #4db8ff;
        color: #000;
    }
}*/