/**
 * Custom Tab Styles for AI Flyer Generator
 */

/* ========================================
   CUSTOM TAB ICON - Fixed Dimensions
   ======================================== */
.wcdp-custom-tab-icon {
    display: inline-block !important;
    width: 45px !important;
    height: 45px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20M10,19L12,15H9V10L7,14H10V19Z"/></svg>'), linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 26px 26px, cover !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

.wcdp-custom-tab-icon:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20M10,19L12,15H9V10L7,14H10V19Z"/></svg>'), linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 26px 26px, cover !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
}

.wcdp-custom-tab-icon.vtab-selected {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20M10,19L12,15H9V10L7,14H10V19Z"/></svg>'), linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 26px 26px, cover !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6) !important;
}

/* ========================================
   FORM CONTAINER
   ======================================== */
#wcdp-ai-flyer-form {
    padding: 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    margin: 10px 0;
}

#wcdp-tabs-content .wcdp-content-tools #wcdp-ai-flyer-form label {
    width: 100% !important;
}

#wcdp-tabs-content #wcdp-ai-flyer-form label {
    border-right: 0px;
}

#wcdp-tabs-content #wcdp-ai-flyer-form select {
    width: 100% !important;
}

/* ========================================
   FORM GROUPS
   ======================================== */
.wcdp-form-group {
    margin-bottom: 18px !important;
    padding: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wcdp-form-group:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.wcdp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #2c3e50;
    text-transform: none;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* ========================================
   FORM INPUTS
   ======================================== */
.wcdp-form-input,
.wcdp-form-select,
.wcdp-form-textarea {
    width: 100% !important;
    padding: 10px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 5px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

.wcdp-form-input:focus,
.wcdp-form-select:focus,
.wcdp-form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.wcdp-form-input::placeholder,
.wcdp-form-textarea::placeholder {
    color: #95a5a6;
    font-style: italic;
    font-size: 12px;
}

/* ========================================
   SELECT DROPDOWN
   ======================================== */
.wcdp-form-select {
    background-color: #fafbfc;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23667eea"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 22px;
    padding-right: 40px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-weight: 500;
}

.wcdp-form-select:hover {
    border-color: #667eea;
}

/* ========================================
   TEXTAREA
   ======================================== */
.wcdp-form-textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.6;
    font-family: inherit;
}

/* ========================================
   GENERATE BUTTON
   ======================================== */
#wcdp-ai-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    border: none;
    position: relative;
    overflow: hidden;
}

#wcdp-ai-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#wcdp-ai-generate:hover::before {
    left: 100%;
}

#wcdp-ai-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#wcdp-ai-generate:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

#wcdp-ai-generate[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */
#wcdp-custom-panel .dp-content-style {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

#wcdp-custom-panel .dp-content-style::-webkit-scrollbar {
    width: 8px;
}

#wcdp-custom-panel .dp-content-style::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#wcdp-custom-panel .dp-content-style::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

#wcdp-custom-panel .dp-content-style::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ========================================
   REQUIRED FIELD INDICATOR
   ======================================== */
.wcdp-form-group:has(input[required]) label::after,
.wcdp-form-group:has(textarea[required]) label::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
    font-size: 14px;
}

/* ========================================
   VALIDATION STYLES
   ======================================== */
.wcdp-form-input:invalid:not(:placeholder-shown),
.wcdp-form-textarea:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.wcdp-form-input:valid:not(:placeholder-shown),
.wcdp-form-textarea:valid:not(:placeholder-shown) {
    border-color: #27ae60;
    background-color: #f0fff4;
}

/* ========================================
   PANEL TITLE
   ======================================== */
#wcdp-custom-panel .dp-title-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .wcdp-form-group {
        padding: 10px;
        margin-bottom: 14px !important;
    }

    .wcdp-form-group label {
        font-size: 10px;
    }

    .wcdp-form-input,
    .wcdp-form-select,
    .wcdp-form-textarea {
        font-size: 12px;
        padding: 8px 10px;
    }

    #wcdp-ai-generate {
        padding: 12px 24px;
        font-size: 12px;
    }

    #wcdp-ai-flyer-form {
        padding: 12px;
    }
}

/* ========================================
   ANIMATION KEYFRAMES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcdp-form-group {
    animation: fadeIn 0.3s ease-out;
}