/**
 * Public-facing styles for the plugin.
 *
 * @package    Fiskekort
 */

/* Overview/Listing */
.fiskekort-oversikt {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.fiskekort-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.fiskekort-filter input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.fiskekort-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.fiskekort-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.fiskekort-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image.placeholder .dashicons {
    font-size: 60px;
    color: rgba(255,255,255,0.5);
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.card-content .location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.card-content .description {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Vald Details */
.fiskekort-vald-detaljer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.vald-header {
    margin-bottom: 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0073aa;
    text-decoration: none;
    margin-bottom: 15px;
}

.back-link:hover {
    text-decoration: underline;
}

.vald-header h1 {
    margin: 10px 0;
    font-size: 32px;
}

.vald-header .location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 16px;
}

.vald-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.vald-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.vald-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Lightbox styles */
.fk-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.fk-lightbox.active {
    display: flex;
}

.fk-lightbox__content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fk-lightbox__image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.fk-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    z-index: 10000;
    transition: background 0.3s;
}

.fk-lightbox__close:hover {
    background: #fff;
}

.fk-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: background 0.3s;
    z-index: 10000;
}

.fk-lightbox__nav:hover {
    background: #fff;
}

.fk-lightbox__nav--prev {
    left: 20px;
}

.fk-lightbox__nav--next {
    right: 20px;
}

.fk-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10000;
}

.vald-content {
    display: block;
}

@media (max-width: 768px) {
    .vald-content {
        display: block;
    }
}

.vald-beskrivelse h2,
.vald-booking h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.vald-beskrivelse {
    margin-bottom: 40px;
}

/* Booking box removed in new flow */
.vald-booking { display: none; }

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.availability-info {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.availability-info.available {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.availability-info.unavailable {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.booking-note {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-top: 15px;
}

/* Flow instruction above calendar */
.calendar-flow-instruction { font-size: 15px; font-weight: 600; margin: 10px 0 20px; color: #004a7c; }
.calendar-flow-instruction a { color: #0073aa; text-decoration: underline; }

/* Modal styles */
.fk-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; z-index: 9999; align-items: flex-start; justify-content: center; padding-top: 60px; }
.fk-modal-dialog { background: #fff; width: 100%; max-width: 460px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); padding: 25px 28px; position: relative; }
.fk-modal-title { margin: 0 0 15px; font-size: 22px; font-weight: 600; color: #222; }
.fk-modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: #666; }
.fk-modal-body p { margin: 0 0 15px; }
.fk-modal-summary { font-weight: 600; color: #333; }
.fk-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 10px; }
.fk-modal-antall-max { display: block; margin-top: 6px; font-size: 12px; color: #555; }
.fk-modal [type=number], .fk-modal [type=tel] { width: 100%; padding: 10px; border:1px solid #ddd; border-radius:6px; }
.fk-modal [type=number]:focus, .fk-modal [type=tel]:focus { outline:none; border-color:#0073aa; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #005a87;
    color: #fff;
}

.btn-primary {
    background: #0073aa;
}

.btn-primary:hover {
    background: #005a87;
}

.btn-large {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
.form-message {
    margin: 15px 0;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Calendar Styles */
.vald-availability-calendar {
/* Owner blocking tool */
.owner-block-tool {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.owner-block-tool h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
    color: #856404;
}

.owner-block-tool p {
    font-size: 14px;
    color: #856404;
    margin: 0 0 15px 0;
}

.owner-calendar-hint {
    background: #ffeed6;
    border: 1px solid #f0b25c;
    color: #9b5d00;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    margin: 0 0 15px 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Calendar Styles */
.vald-availability-calendar {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.vald-availability-calendar h2 {
    margin-top: 0;
    color: #333;
}

.calendar-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Calendar controls (type selector) */
.calendar-controls { display: flex; gap: 10px; align-items: center; margin: 10px 0 10px; }
.calendar-controls select { padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Multi-month season calendars */
.season-calendars {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Toast message for selection guidance */
.calendar-toast { 
    background: #fff3cd; 
    color: #856404; 
    border: 1px solid #ffeeba; 
    padding: 10px 12px; 
    border-radius: 6px; 
    font-size: 14px; 
    margin: 8px 0 14px; 
}

/* Hide døgnkort count overlays when exclusive rental selected */
.season-calendars.hide-counts .availability-count { display: none !important; }

/* Selection range highlighting */
.season-calendars .fc-daygrid-day.selected-start { 
    outline: 3px solid #007bff !important; 
    background-color: rgba(0,123,255,0.35) !important; 
    z-index: 10;
}
.season-calendars .fc-daygrid-day.selected-end { 
    outline: 3px solid #007bff !important;
    background-color: rgba(0,123,255,0.35) !important;
    z-index: 10;
}
.season-calendars .fc-daygrid-day.selected-in-range { 
    background-color: rgba(0,123,255,0.25) !important;
    z-index: 5;
}
.season-calendars .fc-daygrid-day.selected-start.selected-end { 
    background-color: rgba(0,123,255,0.40) !important;
}

.season-month {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e6ea;
}

.season-month h3 {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

#vald-cal-june, #vald-cal-july, #vald-cal-aug {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
}

/* Larger calendar cells */
.fc .fc-daygrid-day-frame {
    min-height: 80px;
    padding: 8px;
}

.fc .fc-daygrid-day-number {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
}

.fc .fc-daygrid-day-top {
    display: flex;
    justify-content: center;
}

/* Desktop: 3 calendars in one row */
@media (min-width: 1100px) {
    .season-calendars {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablet: 2 calendars in a row */
@media (min-width: 768px) and (max-width: 1099px) {
    .season-calendars {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .season-calendars {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .season-month {
        padding: 15px;
    }
    
    .fc .fc-daygrid-day-frame {
        min-height: 60px;
        padding: 4px;
    }
}

/* FullCalendar customization */
.fc .fc-daygrid-day.fc-day-out-of-season {
    background-color: #f5f5f5;
    opacity: 0.5;
}

/* Red mark for days without entered capacity or fully blocked for all types */
.fc .fc-daygrid-day.fc-day-unavailable {
    background-color: rgba(220, 53, 69, 0.18); /* light red */
}

.fc .fc-daygrid-day:hover {
    background-color: rgba(0, 115, 170, 0.1);
    cursor: pointer;
}

.fc .fc-daygrid-event.availability-count {
    font-size: 11px;
    font-weight: bold;
    padding: 2px;
    border: none;
    text-align: center;
}

.fc .fc-event-title {
    overflow: visible;
    white-space: nowrap;
}

/* Beat Trends Section */
.fk-beat-trends-wrapper {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.fk-beat-trends-wrapper h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.fk-beat-trends-wrapper h4 {
    margin: 25px 0 15px 0;
    font-size: 18px;
    color: #34495e;
}

/* Stats Grid */
.beat-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border-left: 4px solid #3498db;
}

.stat-label {
    font-size: 13px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-range {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
}

/* Recommendations */
.beat-recommendations {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.recommendation-items {
    display: grid;
    gap: 12px;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #27ae60;
}

.rec-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.rec-content {
    flex: 1;
    font-size: 14px;
    color: #555;
}

.rec-content strong {
    color: #2c3e50;
}

/* Water Level Distribution */
.water-level-distribution-section {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

#water-level-distribution {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.water-bar-item {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 10px;
}

.water-bar-label {
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.water-bar {
    height: 24px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.water-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
}

.water-bar-count {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    text-align: right;
}

/* Equipment Distribution */
.equipment-distribution-section {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.equipment-distribution {
    display: grid;
    gap: 14px;
}

.equipment-item {
    display: grid;
    grid-template-columns: 140px 1fr 180px;
    align-items: center;
    gap: 12px;
}

.equipment-label {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.equipment-bar {
    background: #e2e8f0;
    border-radius: 999px;
    height: 24px;
    overflow: hidden;
}

.equipment-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 999px;
    transition: width 0.8s ease;
}

.equipment-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.equipment-percentage {
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
}

.equipment-count {
    font-size: 13px;
    color: #64748b;
}

.trends-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #7f8c8d;
}

/* Water Meter Integration */
.fk-water-meter {
    margin-top: 30px;
    margin-bottom: 30px;
}

.fk-water-meter h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #2c3e50;
    font-weight: 600;
}

.fk-water-meter__card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 0;
    color: #fff;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.fk-water-meter__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
}

.fk-water-meter__header {
    background: rgba(0, 0, 0, 0.15);
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fk-water-meter__label {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fk-water-meter__label::before {
    content: "📍";
    font-size: 18px;
}

.fk-water-meter__body {
    padding: 28px 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.fk-water-meter__main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fk-water-meter__value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.fk-water-meter__icon {
    font-size: 48px;
    opacity: 0.9;
}

.fk-water-meter__value {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.fk-water-meter__unit {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.85;
}

.fk-water-meter__temp {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.fk-water-meter__temp-icon {
    font-size: 28px;
}

.fk-water-meter__temp-value {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.fk-water-meter__temp-label {
    font-size: 11px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.fk-water-meter__footer {
    background: rgba(0, 0, 0, 0.1);
    padding: 12px 24px;
    font-size: 12px;
    opacity: 0.85;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fk-water-meter__footer::before {
    content: "⏱";
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vald-gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .vald-gallery img {
        height: 200px;
    }
    
    .fk-water-meter__body {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .fk-water-meter__temp {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        width: 100%;
    }
    
    .fk-water-meter__value {
        font-size: 48px;
    }
    
    .fk-water-meter__icon {
        font-size: 40px;
    }
    
    .fk-lightbox__nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .fk-lightbox__nav--prev {
        left: 10px;
    }
    
    .fk-lightbox__nav--next {
        right: 10px;
    }
    
    .fk-lightbox__close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .beat-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .water-bar-item {
        grid-template-columns: 100px 1fr 50px;
        gap: 8px;
    }
    
    .water-bar-label {
        font-size: 12px;
    }
    
    .equipment-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .equipment-stats {
        justify-content: flex-start;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .vald-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fk-water-meter__value {
        font-size: 48px;
    }
}
