/**
 * Писане с вино - Frontend стилове
 * Mobile-First Responsive Design
 * Version 2.0 - Updated with Google Maps button
 */

/* ============================================
   ОБЩИ СТИЛОВЕ И ПРОМЕНЛИВИ
============================================ */

:root {
    --pv-primary: #8B4513;
    --pv-primary-dark: #5D2A0C;
    --pv-secondary: #D2691E;
    --pv-success: #46b450;
    --pv-warning: #ffc107;
    --pv-danger: #dc3232;
    --pv-google-blue: #4285F4;
    --pv-google-blue-dark: #3367D6;
    --pv-light: #f9f9f9;
    --pv-dark: #23282d;
    --pv-gray: #666;
    --pv-border: #ddd;
    --pv-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --pv-radius: 8px;
    --pv-transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

/* ============================================
   CONTAINER
============================================ */

.pv-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   SINGLE EVENT PAGE
============================================ */

.pv-single-event-wrapper {
    background-color: var(--pv-light);
    padding: 40px 0;
}

.pv-single-event {
    background: #fff;
    border-radius: var(--pv-radius);
    box-shadow: var(--pv-shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

/* Event Header */
.pv-event-header {
    padding: 30px;
    background: linear-gradient(135deg, var(--pv-primary) 0%, var(--pv-secondary) 100%);
    color: #fff;
}

.pv-event-title {
    margin: 0 0 20px;
    font-size: 28px;
    line-height: 1.3;
    font-weight: bold;
}

.pv-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.pv-meta-item {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    gap: 8px; /* Добавя разстояние между emoji и текст */
}

/* Подравняване на emoji иконки */
.pv-meta-item img.emoji {
    width: 16px;
    height: 16px;
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    flex-shrink: 0; /* Предотвратява свиване на иконката */
}

/* ============================================
   GOOGLE MAPS BUTTON
============================================ */

.pv-btn-maps {
    display: inline-block;
    padding: 8px 16px;
    background: var(--pv-google-blue);
    color: #fff !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    transition: var(--pv-transition);
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
}

.pv-btn-maps:hover {
    background: var(--pv-google-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.pv-btn-maps:active {
    transform: translateY(0);
}

.pv-meta-item.pv-maps-button {
    background: transparent;
    padding: 0;
}

/* Capacity Bar */
.pv-capacity-bar {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: var(--pv-radius);
}

.pv-capacity-info {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
}

.pv-available {
    color: #fff;
}

.pv-available.pv-full {
    color: #ffcccc;
}

.pv-progress {
    background: rgba(255, 255, 255, 0.3);
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
}

.pv-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pv-success) 0%, var(--pv-warning) 70%, var(--pv-danger) 100%);
    transition: width 0.5s ease;
    border-radius: 20px;
}

/* Featured Image */
.pv-event-featured-image {
    line-height: 0;
}

.pv-event-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Event Content */
.pv-event-content {
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--pv-dark);
}

.pv-event-content p {
    margin-bottom: 15px;
}

.pv-event-content h2,
.pv-event-content h3 {
    color: var(--pv-primary);
    margin-top: 25px;
    margin-bottom: 15px;
}

/* ============================================
   BOOKING FORM SECTION
============================================ */

.pv-booking-section {
    padding: 40px 30px;
    background: linear-gradient(to bottom, #fff 0%, var(--pv-light) 100%);
    border-top: 3px solid var(--pv-primary);
}

.pv-booking-title {
    font-size: 24px;
    margin: 0 0 25px;
    color: var(--pv-primary);
    text-align: center;
}

/* Form Styles */
.pv-form {
    max-width: 600px;
    margin: 0 auto;
}

.pv-form-row {
    margin-bottom: 20px;
}

.pv-form-row-two {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.pv-form-group {
    display: flex;
    flex-direction: column;
}

.pv-form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--pv-dark);
    font-size: 14px;
}

.pv-form-group input[type="text"],
.pv-form-group input[type="email"],
.pv-form-group input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--pv-border);
    border-radius: var(--pv-radius);
    font-size: 16px;
    transition: var(--pv-transition);
    font-family: inherit;
}

.pv-form-group input:focus {
    outline: none;
    border-color: var(--pv-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.pv-form-group input::placeholder {
    color: #999;
}

/* Form Footer */
.pv-form-footer {
    margin-top: 30px;
    text-align: center;
}

/* ============================================
   BUTTONS
============================================ */

.pv-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--pv-radius);
    cursor: pointer;
    transition: var(--pv-transition);
    font-family: inherit;
}

.pv-btn-primary {
    background: linear-gradient(135deg, var(--pv-primary) 0%, var(--pv-secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.pv-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

.pv-btn-primary:active {
    transform: translateY(0);
}

.pv-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pv-btn-secondary {
    background: #fff;
    color: var(--pv-primary);
    border: 2px solid var(--pv-primary);
}

.pv-btn-secondary:hover {
    background: var(--pv-primary);
    color: #fff;
}

.pv-btn-outline {
    background: transparent;
    color: var(--pv-primary);
    border: 2px solid var(--pv-primary);
}

.pv-btn-outline:hover {
    background: var(--pv-primary);
    color: #fff;
}

.pv-btn-small {
    padding: 10px 20px;
    font-size: 14px;
}

/* Loading Spinner */
.pv-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: pv-spin 0.6s linear infinite;
}

@keyframes pv-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ALERTS & MESSAGES
============================================ */

.pv-alert {
    padding: 20px;
    border-radius: var(--pv-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.pv-alert-warning {
    background: #fff3cd;
    border-color: var(--pv-warning);
    color: #856404;
}

.pv-alert p {
    margin: 0 0 10px;
}

.pv-alert p:last-child {
    margin-bottom: 0;
}

.pv-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--pv-radius);
    font-weight: bold;
    animation: pv-fadeIn 0.3s ease;
}

.pv-form-message.pv-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--pv-success);
}

.pv-form-message.pv-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--pv-danger);
}

@keyframes pv-fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   BACK LINK
============================================ */

.pv-back-link {
    text-align: center;
    margin-bottom: 40px;
}

/* ============================================
   ARCHIVE PAGE
============================================ */

.pv-archive-wrapper {
    background-color: var(--pv-light);
    padding: 40px 0 60px;
    min-height: 70vh;
}

.pv-archive-header {
    text-align: center;
    margin-bottom: 50px;
}

.pv-archive-title {
    font-size: 32px;
    color: var(--pv-primary);
    margin: 0 0 15px;
}

.pv-archive-description {
    font-size: 18px;
    color: var(--pv-gray);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Events Grid */
.pv-events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Event Card */
.pv-event-card {
    background: #fff;
    border-radius: var(--pv-radius);
    box-shadow: var(--pv-shadow);
    overflow: hidden;
    transition: var(--pv-transition);
    display: flex;
    flex-direction: column;
}

.pv-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.pv-event-card.pv-event-full {
    opacity: 0.85;
}

/* Card Image */
.pv-card-image {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.pv-card-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pv-event-card:hover .pv-card-image img {
    transform: scale(1.05);
}

/* Badge */
.pv-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.pv-badge-full {
    background: var(--pv-danger);
}

.pv-badge-limited {
    background: var(--pv-warning);
    color: var(--pv-dark);
}

/* Card Content */
.pv-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pv-card-date {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--pv-primary);
    color: #fff;
    border-radius: var(--pv-radius);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.pv-date-day {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.pv-date-month {
    font-size: 14px;
    text-transform: uppercase;
    margin-top: 3px;
}

.pv-date-weekday {
    font-size: 11px;
    opacity: 0.8;
}

.pv-card-title {
    font-size: 22px;
    margin: 0 0 15px;
}

.pv-card-title a {
    color: var(--pv-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.pv-card-title a:hover {
    color: var(--pv-primary);
}

.pv-card-meta {
    margin-bottom: 15px;
    color: var(--pv-gray);
    font-size: 14px;
}

.pv-card-meta .pv-meta-item {
    display: block;
    margin-bottom: 8px;
}

.pv-card-excerpt {
    color: var(--pv-gray);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

/* ============================================
   CARD FOOTER - MOBILE FIRST (ПОПРАВКА)
============================================ */

/* Card Footer - Mobile (stacked layout) */
.pv-card-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--pv-border);
}

.pv-spots-info {
    font-size: 14px;
    width: 100%;
    text-align: center;
}

.pv-spots {
    font-weight: bold;
    display: block;
}

.pv-spots-available {
    color: var(--pv-success);
}

.pv-spots-full {
    color: var(--pv-danger);
}

/* Бутон на пълна ширина на мобилен */
.pv-card-footer .pv-btn-small {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
}

/* Empty State */
.pv-no-events {
    text-align: center;
    padding: 80px 20px;
}

.pv-empty-state {
    max-width: 500px;
    margin: 0 auto;
}

.pv-empty-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
}

.pv-empty-state h2 {
    font-size: 28px;
    color: var(--pv-dark);
    margin-bottom: 15px;
}

.pv-empty-state p {
    font-size: 16px;
    color: var(--pv-gray);
}

/* ============================================
   FORM VALIDATION STYLES
============================================ */

.pv-form-group input.pv-valid {
    border-color: var(--pv-success);
}

.pv-form-group input.pv-invalid {
    border-color: var(--pv-danger);
    background-color: #fff5f5;
}

.pv-field-error {
    display: none;
    color: var(--pv-danger);
    font-size: 13px;
    margin-top: 5px;
    font-weight: normal;
}

.pv-form.is-submitting {
    opacity: 0.7;
    pointer-events: none;
}

.pv-btn.pv-loading {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Success celebration animation */
@keyframes pv-celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pv-form-message.pv-celebrate {
    animation: pv-celebrate 0.5s ease-in-out;
}

/* Pulse animation for capacity warning */
@keyframes pv-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pv-available.pv-full {
    animation: pv-pulse 2s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE - TABLET (768px+)
============================================ */

@media (min-width: 768px) {
    .pv-container {
        padding: 0 40px;
    }
    
    .pv-event-title {
        font-size: 36px;
    }
    
    .pv-form-row-two {
        grid-template-columns: 1fr 1fr;
    }
    
    .pv-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .pv-archive-title {
        font-size: 42px;
    }
    
    .pv-booking-title {
        font-size: 28px;
    }
    
    /* Card Footer - Horizontal layout на tablet+ */
    .pv-card-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
    
    .pv-spots-info {
        width: auto;
        text-align: left;
        flex: 1;
    }
    
    .pv-card-footer .pv-btn-small {
        width: auto;
        padding: 10px 20px;
        font-size: 14px;
        flex-shrink: 0;
    }
    
    /* Google Maps button остава inline на tablet */
    .pv-btn-maps {
        display: inline-block;
        width: auto;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP (1024px+)
============================================ */

@media (min-width: 1024px) {
    .pv-single-event-wrapper {
        padding: 60px 0;
    }
    
    .pv-event-header {
        padding: 50px;
    }
    
    .pv-event-content {
        padding: 50px;
    }
    
    .pv-booking-section {
        padding: 60px 50px;
    }
    
    .pv-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .pv-archive-wrapper {
        padding: 60px 0 80px;
    }
}

/* ============================================
   RESPONSIVE - LARGE DESKTOP (1280px+)
============================================ */

@media (min-width: 1280px) {
    .pv-events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   RESPONSIVE - MOBILE SPECIFIC
============================================ */

@media (max-width: 767px) {
    .pv-event-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .pv-meta-item {
        width: 100%;
        justify-content: center;
    }
    
    .pv-btn-maps {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
    
    .pv-meta-item.pv-maps-button {
        width: 100%;
    }
}

/* ============================================
   PRINT STYLES
============================================ */

@media print {
    .pv-booking-section,
    .pv-back-link,
    .pv-btn-maps {
        display: none;
    }
    
    .pv-single-event {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ============================================
   EMOJI ICON FIX
============================================ */

.pv-meta-item {
    gap: 8px;
}

.pv-meta-item img.emoji {
    width: 16px !important;
    height: 16px !important;
    vertical-align: baseline !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
    display: inline-block !important;
}

/* Mobile - адрес с много текст */
@media (max-width: 767px) {
    .pv-meta-item.pv-location {
        align-items: flex-start !important;
    }
    
    .pv-meta-item.pv-location img.emoji {
        margin-top: 2px !important;
    }
}
