/* Creator Form Styles - Extracted from frontend.php inline styles */
#wppostcards-postcard-creator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.postcard-form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 10;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.5s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px;
}

.preview-column {
    position: sticky;
    top: 20px;
}

.wppostcards-panel {
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
}

.wppostcards-panel:last-child {
    border-bottom: none;
}

.wppostcards-panel-header {
    margin-bottom: 6px;
}

.wppostcards-panel-title {
    margin: 0;
    font-size: 1.1rem;
    /* font-weight: 600; */
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wppostcards-panel-icon {
    font-size: 1.3rem;
    line-height: 1;
    opacity: 0.8;
}

.wppostcards-panel-body {
    padding: 0;
}

.wppostcards-panel-preview {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.wppostcards-panel-preview .wppostcards-panel-header {
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

#wppostcards-image-options {
    display: grid;
    grid-template-columns: repeat(var(--wpp-creator-columns, 3), 1fr);
    gap: 15px;
}

.image-option {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding-bottom: 75%;
}

.image-option input {
    display: none;
}

.image-option img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.image-option:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.image-option input:checked + img {
    border: 4px solid #007bff;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #007bff, 0 4px 12px rgba(0, 123, 255, 0.4);
    transform: scale(0.98);
}

/* More specific selectors to override theme styles */
#wppostcards-postcard-creator input[type="text"],
#wppostcards-postcard-creator textarea,
#wppostcards-postcard-creator select {
    width: 100%;
    padding: 12px !important;
    margin-top: 8px;
    font-size: 16px;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px !important;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff !important;
}

#wppostcards-postcard-creator .title-input {
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px !important;
}

#wppostcards-postcard-creator input[type="text"]:focus,
#wppostcards-postcard-creator textarea:focus,
#wppostcards-postcard-creator select:focus {
    outline: none;
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#wppostcards-postcard-creator .signature-input {
    padding: 12px !important;
}

/* Category selector needs reduced padding to prevent text clipping from theme */
#wppostcards-postcard-creator select.wppostcards-category-select {
    padding: 8px 12px !important;
    height: auto;
    line-height: 1.4;
}

.wppostcards-title-input-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

.wppostcards-title-input-wrapper .title-input {
    flex: 1;
    margin-top: 0;
}

.wppostcards-dropdown-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid #5a67d8;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.wppostcards-dropdown-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.5);
}

.wppostcards-dropdown-btn:active {
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
}

.wppostcards-dropdown-arrow {
    font-size: 10px;
}

.wppostcards-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 250px;
}

.wppostcards-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

.wppostcards-dropdown-item:last-child {
    border-bottom: none;
}

.wppostcards-dropdown-item:hover {
    background-color: #f5f7ff;
}

.wppostcards-dropdown-item.disabled {
    color: #999;
    cursor: not-allowed;
}

.wppostcards-dropdown-item.disabled:hover {
    background-color: transparent;
}

/* Floating preview tooltip for dropdown items */
.wppostcards-dropdown-preview {
    position: fixed;
    z-index: 100001;
    background: #fff;
    border: 1px solid #c5c5c5;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    padding: 14px 18px;
    max-width: 340px;
    min-width: 120px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    white-space: normal;
    pointer-events: none;
    animation: wpp-tooltip-in 0.15s ease;
}

@keyframes wpp-tooltip-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

#wp-wppostcards-custom-message-wrap {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.postcard-preview-container {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 30px;
}

.preview-image-wrapper {
    text-align: center;
    margin-bottom: 15px;
}

.preview-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.preview-message-wrapper {
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    min-height: 100px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.preview-message-wrapper h3 {
    font-size: var(--wpp-creator-title-size, 1.5rem) !important;
    color: #2c3e50;
    margin: 0 0 15px 0 !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.preview-message-wrapper p {
    margin: 0;
}

.preview-signature-wrapper {
    text-align: right;
    font-style: italic;
    color: #666;
    font-size: 14px;
    padding: 10px 15px 0 0;
}

@media (max-width: 768px) {
    .postcard-form-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .preview-column {
        position: static;
    }

    #wppostcards-image-options {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .form-group h3 {
        font-size: 1.1rem;
    }

    .wppostcards-panel {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .wppostcards-panel-title {
        font-size: 1rem;
    }

    .wppostcards-panel-icon {
        font-size: 1.2rem;
    }

    .wppostcards-panel-preview {
        padding: 16px;
    }

    .wppostcards-title-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .wppostcards-dropdown-btn {
        width: 100%;
        justify-content: center;
    }
}

/* TinyMCE customizations */
#wp-wppostcards-custom-message-wrap .mce-path,
#wp-wppostcards-custom-message-wrap .mce-statusbar,
#wp-wppostcards-custom-message-wrap .tox-statusbar,
#wp-wppostcards-custom-message-wrap .tox-statusbar__path {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Highlight custom TinyMCE dropdowns */
#wp-wppostcards-custom-message-wrap .wppostcards-title-dropdown button,
#wp-wppostcards-custom-message-wrap .wppostcards-message-dropdown button,
.wppostcards-title-dropdown button,
.wppostcards-message-dropdown button,
#wp-wppostcards-custom-message-wrap .mce-btn.mce-listbox button[aria-label*="Sample Titles"],
#wp-wppostcards-custom-message-wrap .mce-btn.mce-listbox button[aria-label*="Sample Messages"],
#wp-wppostcards-custom-message-wrap button[aria-label*="Sample Titles"],
#wp-wppostcards-custom-message-wrap button[aria-label*="Sample Messages"],
.mce-container .mce-btn.mce-listbox button[aria-label*="Sample Titles"],
.mce-container .mce-btn.mce-listbox button[aria-label*="Sample Messages"],
#wp-wppostcards-custom-message-wrap .mce-toolbar button[aria-label="Sample Titles"],
#wp-wppostcards-custom-message-wrap .mce-toolbar button[aria-label="Sample Messages"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: 2px solid #5a67d8 !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
    padding: 4px 10px !important;
    transition: all 0.3s ease !important;
}

#wp-wppostcards-custom-message-wrap .wppostcards-title-dropdown button:hover,
#wp-wppostcards-custom-message-wrap .wppostcards-message-dropdown button:hover,
.wppostcards-title-dropdown button:hover,
.wppostcards-message-dropdown button:hover,
#wp-wppostcards-custom-message-wrap .mce-btn.mce-listbox button[aria-label*="Sample Titles"]:hover,
#wp-wppostcards-custom-message-wrap .mce-btn.mce-listbox button[aria-label*="Sample Messages"]:hover,
#wp-wppostcards-custom-message-wrap button[aria-label*="Sample Titles"]:hover,
#wp-wppostcards-custom-message-wrap button[aria-label*="Sample Messages"]:hover,
.mce-container .mce-btn.mce-listbox button[aria-label*="Sample Titles"]:hover,
.mce-container .mce-btn.mce-listbox button[aria-label*="Sample Messages"]:hover,
#wp-wppostcards-custom-message-wrap .mce-toolbar button[aria-label="Sample Titles"]:hover,
#wp-wppostcards-custom-message-wrap .mce-toolbar button[aria-label="Sample Messages"]:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6) !important;
}

#wp-wppostcards-custom-message-wrap .mce-listbox button {
    min-width: 120px !important;
}

#wp-wppostcards-custom-message-wrap .mce-btn button span,
#wp-wppostcards-custom-message-wrap .mce-listbox button span {
    color: inherit !important;
}

@keyframes gentle-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 2px 12px rgba(102, 126, 234, 0.7);
    }
}

#wp-wppostcards-custom-message-wrap button[aria-label*="Sample Titles"],
#wp-wppostcards-custom-message-wrap button[aria-label*="Sample Messages"] {
    animation: gentle-pulse 3s ease-in-out infinite !important;
}

/* Preview popup styling */
#wppostcards-image-preview {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow: hidden;
    padding: 6px;
    max-width: 360px;
    max-height: 360px;
}

#wppostcards-image-preview img {
    display:block;
    width:100%;
    height:auto;
}

@media (max-width: 480px) {
    #wppostcards-image-preview {
        max-width: 90vw;
        max-height: 60vh;
    }
}

/* Category selector */
.wppostcards-category-select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    cursor: pointer;
}

.wppostcards-category-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Language Toggle */
.wppostcards-language-panel {
    background: #f0f7ff;
    border: 1px solid #b3d7ff;
}
.wppostcards-language-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.wppostcards-lang-radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 14px;
    transition: background 0.2s;
}
.wppostcards-lang-radio:hover {
    background: rgba(0, 123, 255, 0.08);
}
.wppostcards-lang-radio input[type="radio"]:checked + span,
.wppostcards-lang-radio:has(input:checked) {
    font-weight: 600;
}

/* Translation Gate */
#wppostcards-translate-gate {
    text-align: center;
}
#wppostcards-translate-cta {
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}
#wppostcards-translate-cta:hover {
    background: #007bff;
    color: #fff;
}
#wppostcards-submit-btn[disabled] {
    cursor: not-allowed;
}
