/**
 * Virtual Candles - Frontend Styles
 * 
 * @package STstudio\VirtualCandles
 * @since   2.0.0
 */

/* ==========================================================================
   Global Resets und Box Model
   ========================================================================== */

/* Box-sizing für alle Elemente */
.vc-form-wrapper *,
.lichter-formular *,
.lichter-group *,
.vc-display-wrapper *,
.vc-chapel-display * {
    box-sizing: border-box;
}

/* ==========================================================================
   Formular Basis-Styles
   ========================================================================== */

.vc-form-wrapper {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.vc-form-title {
    text-align: center;
    margin-bottom: 2rem;
}

.lichter-formular {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Formular-Zeilen */
.lichter-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lichter-form-col {
    flex: 1 1 100%;
}

@media (min-width: 600px) {
    .lichter-form-col {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

@media (max-width: 599px) {
    .lichter-form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .lichter-form-col {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Formular-Elemente
   ========================================================================== */

/* Input-Felder */
.lichter-formular input[type="text"],
.lichter-formular input[type="email"],
.lichter-formular textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
    max-width: 100%;
}

.lichter-formular input[type="text"]:focus,
.lichter-formular input[type="email"]:focus,
.lichter-formular textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Fehler-Nachrichten */
.vc-error-message {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.2em;
}

.lichter-formular input.error,
.lichter-formular textarea.error {
    border-color: #dc3545;
}

/* Textarea */
.lichter-formular textarea {
    resize: vertical;
    min-height: 80px;
}

/* Zeichenzähler */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #ff6b35;
    font-weight: bold;
}

/* ==========================================================================
   Kerzenbild Container
   ========================================================================== */

.kerzenbild-container {
    text-align: center;
    padding: 1rem;
}

.kerzenbild {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.kerze-vorschau {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

.kerze-vorschau span {
    display: block;
}

/* ==========================================================================
   Checkbox & Datenschutz
   ========================================================================== */

.customCheckbox {
    margin: 1.5rem 0;
}

.customCheckbox label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
}

.customCheckbox input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.checkbox-custom {
    display: none; /* Falls custom checkbox gewünscht */
}

.dsgvo_hinweis {
    margin-top: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 3px solid #ff6b35;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
}

.dsgvo_hinweis a {
    color: #ff6b35;
    text-decoration: underline;
}

.dsgvo_hinweis a:hover {
    text-decoration: none;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.vc-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 14px 28px;
    background-color: #ff6b35;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.vc-submit-button:hover:not(:disabled) {
    background-color: #e85a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.vc-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.vc-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Loader */
.button-loader {
    margin-left: 10px;
}

.vc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: vc-spin 1s ease-in-out infinite;
}

@keyframes vc-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Formular-Nachrichten
   ========================================================================== */

.vc-form-messages {
    margin-top: 1rem;
    text-align: center;
}

.vc-form-messages .success-message,
.vc-form-messages .error-message {
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 500;
    animation: vc-fadeIn 0.3s ease-in-out;
}

.vc-form-messages .success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vc-form-messages .error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes vc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Honeypot (Spam-Schutz)
   ========================================================================== */

.vc-honey {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
}

/* ==========================================================================
   Responsive Anpassungen
   ========================================================================== */

@media (max-width: 768px) {
    .lichter-formular {
        padding: 1.5rem;
    }
    
    .lichter-form-col {
        flex: 1 1 100%;
    }
    
    .vc-submit-button {
        width: 100%;
    }
}

/* ==========================================================================
   JavaScript-Animationen
   ========================================================================== */

/* Kerze brennt Animation */
.kerzenbild.burning {
    animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { filter: brightness(1) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1)); }
    50% { filter: brightness(1.1) drop-shadow(0 0 20px rgba(255, 107, 53, 0.5)); }
}

/* Glüh-Effekt */
.glow-effect {
    position: relative;
}

.glow-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: glow 2s ease-in-out;
    pointer-events: none;
}

@keyframes glow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Funkeln-Effekt */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffeb3b;
    border-radius: 50%;
    animation: sparkle 3s ease-in-out;
    pointer-events: none;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0);
    }
}

/* ==========================================================================
   Kerzen-Grid für Archiv
   ========================================================================== */

.lichter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.lichter-column {
    flex: 1 calc(10% - 1rem);
    min-width: 100px;
    text-align: center;
}

.licht-single-content {
    transition: transform 0.3s ease;
}

.licht-single-content:hover {
    transform: translateY(-5px);
}

.licht-single-content a {
    text-decoration: none;
    color: inherit;
}

.licht-img-wrap {
    margin-bottom: 0.5rem;
    position: relative;
}

.licht-img-wrap img {
    width: 100%;
    height: auto;
    max-width: 280px;
}

.licht-time-remaining {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
}

.licht-info {
    font-size: 0.75rem;
}

.licht-heading, .licht-von {
    display: block;
}

/* Load More Button */
.vc-load-more {
    display: block;
    margin: 2rem auto;
    padding: 12px 24px;
    background-color: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vc-load-more:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.vc-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Responsive Anpassungen für Grid
   ========================================================================== */

@media (max-width: 1200px) {
    .lichter-column {
        flex: 0 0 calc(20% - 1rem);
    }
}

@media (max-width: 768px) {
    .lichter-column {
        flex: 0 0 calc(33.333% - 1rem);
    }
}

@media (max-width: 480px) {
    .lichter-column {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

/* ==========================================================================
   Display Wrapper
   ========================================================================== */

.vc-display-wrapper {
    margin: 2rem 0;
}

.vc-display-title {
    text-align: center;
    margin-bottom: 2rem;
}

/* Form Toggle */
.vc-form-toggle-container {
    text-align: center;
    margin-bottom: 2rem;
}

.vc-toggle-form {
    margin: 0 auto;
}

.vc-form-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.vc-form-container.active {
    max-height: 1000px;
}

.vc-no-candles {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   Chapel Display (Kapellen-Ansicht)
   ========================================================================== */

.vc-chapel-display {
    position: relative;
    background: #000;
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
}

.vc-chapel-display.vc-fullscreen {
    width: 100vw;
    height: 100vh;
}

/* Karussell-Modus */
.vc-carousel-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.vc-carousel-track {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    will-change: transform;
}

.vc-carousel-track .lichter-column {
    flex-shrink: 0;
    width: 200px;
    margin: 0 10px;
}

/* Grid-Modus mit Rotation */
.vc-grid-container {
    display: grid;
    grid-template-columns: repeat(var(--columns, 10), 1fr);
    grid-template-rows: repeat(var(--rows, 3), 1fr);
    gap: 1rem;
    height: 100vh;
    width: 100vw;
    padding: 2rem;
    box-sizing: border-box;
}

.vc-grid-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.vc-grid-slot .lichter-column {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.vc-grid-slot.empty {
    opacity: 0.1;
    border: 0;
}

/* Kerzen in Kapellen-Ansicht */
.vc-chapel-display .lichter-column {
    text-align: center;
}

.vc-chapel-display .licht-img-wrap {
    position: relative;
}

.vc-chapel-display .licht-time-remaining {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.vc-chapel-display .licht-info {
    margin-top: 0.5rem;
}

.vc-chapel-display .licht-heading,
.vc-chapel-display .licht-von {
    color: #fff;
}

/* Status-Anzeige */
.vc-chapel-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.vc-candle-count {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vc-count {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff6b35;
}

.vc-label {
    font-size: 1.2rem;
}

.vc-update-time {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Vollbild-Toggle */
.vc-fullscreen-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 11;
    transition: all 0.3s ease;
    opacity: 0;
}

.vc-chapel-display.vc-fullscreen:hover .vc-fullscreen-toggle {
    opacity: 1;
}

.vc-fullscreen-toggle:hover, .vc-fullscreen-toggle:focus {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.vc-fullscreen-toggle svg {
    fill: #fff;
    display: block;
}

/* Vollbild-Modus */
.vc-chapel-display.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

/* Versteckte Kerzen für Rotation */
.vc-hidden-candles {
    display: none !important;
}

/* ==========================================================================
   GIF Preview (Admin)
   ========================================================================== */

.vc-gif-preview {
    margin: 2rem 0;
}

.vc-gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.vc-gif-item {
    text-align: center;
}

.vc-gif-item img {
    width: 100%;
    height: auto;
    max-width: 80px;
}

.vc-gif-item p {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* ==========================================================================
   Single Candle Display
   ========================================================================== */

.vc-single-candle {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.vc-back-link {
    margin-bottom: 1.5rem;
}

.vc-back-link a {
    color: #ff6b35;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.vc-back-link a:hover {
    color: #e85a2a;
    text-decoration: underline;
}

.vc-candle-display {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.vc-candle-image {
    flex-shrink: 0;
    text-align: center;
}

.vc-candle-image img {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.vc-burning-time {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

.vc-candle-expired {
    color: #999;
    font-style: italic;
    padding: 2rem;
    text-align: center;
}

.vc-candle-info {
    flex: 1;
}

.vc-candle-for {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #333;
}

.vc-candle-message {
    background: #f8f9fa;
    padding: 1.5rem;
    border-left: 4px solid #ff6b35;
    margin: 1.5rem 0;
    line-height: 1.6;
    font-size: 1rem;
    color: #555;
}

.vc-candle-from {
    font-size: 1.125rem;
    color: #666;
    margin: 1rem 0;
}

.vc-candle-lit-date {
    font-size: 0.875rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Send Section on Single Page */
.vc-send-section {
    margin-top: 2rem;
}

.vc-toggle-send-form {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.vc-send-section .vc-form-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 1.5rem;
}

.vc-send-section .vc-form-container.active {
    max-height: 1000px;
}

/* Responsive für Single Candle */
@media (max-width: 768px) {
    .vc-candle-display {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .vc-candle-info {
        width: 100%;
    }
    
    .vc-candle-for {
        font-size: 1.5rem;
    }
    
    .vc-toggle-send-form {
        width: 100%;
        max-width: none;
    }
}

/* ==========================================================================
   Dark Mode Support (optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Kann bei Bedarf erweitert werden */
}

