/**
 * PrettyCode Formatter Frontend Styles
 */

.pcf-frontend-wrapper {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pcf-frontend-header {
    margin-bottom: 20px;
}

.pcf-frontend-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.pcf-frontend-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #2271b1;
}

.pcf-formatter-container.pcf-frontend-container {
    background: #fff;
    border: 1px solid #dcdcde;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 25px;
    border-radius: 8px;
}

.pcf-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dcdcde;
    flex-wrap: wrap;
    gap: 15px;
}

.pcf-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcf-type-selector label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.pcf-type-selector select {
    min-width: 150px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pcf-type-selector select:hover {
    border-color: #2271b1;
}

.pcf-type-selector select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.pcf-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pcf-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    height: auto;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pcf-actions .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.pcf-actions .button-primary:hover:not(:disabled) {
    background: #135e96;
    border-color: #135e96;
}

.pcf-actions .button:not(.button-primary) {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #1d2327;
}

.pcf-actions .button:not(.button-primary):hover:not(:disabled) {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.pcf-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pcf-actions .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pcf-editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .pcf-editor-wrapper {
        grid-template-columns: 1fr;
    }
}

.pcf-editor-section {
    display: flex;
    flex-direction: column;
}

.pcf-editor-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.pcf-editor-section h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #2271b1;
}

.pcf-code-editor {
    width: 100%;
    min-height: 350px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #f6f7f7;
    color: #1d2327;
    resize: vertical;
    tab-size: 2;
    -moz-tab-size: 2;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    box-sizing: border-box;
}

.pcf-code-editor:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    background: #fff;
}

.pcf-code-editor[readonly] {
    background: #f0f0f1;
    cursor: text;
}

.pcf-code-editor[readonly]:focus {
    background: #f6f7f7;
}

.pcf-info-box {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 4px;
}

.pcf-info-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

.pcf-info-box h4 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #2271b1;
}

.pcf-info-box ul {
    margin: 0;
    padding-left: 20px;
}

.pcf-info-box li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #1d2327;
}

.pcf-info-box li:last-child {
    margin-bottom: 0;
}

/* Loading state */
.pcf-format-btn-frontend.loading,
#pcf-format-btn-frontend.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.pcf-format-btn-frontend.loading .dashicons,
#pcf-format-btn-frontend.loading .dashicons {
    animation: pcf-spin 1s linear infinite;
}

@keyframes pcf-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Success/Error messages */
.pcf-message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
    font-size: 14px;
    font-weight: 500;
}

.pcf-message.show {
    display: block;
    animation: pcf-fadeIn 0.3s ease-in;
}

@keyframes pcf-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pcf-message.success {
    background: #00a32a;
    color: #fff;
    border-left: 4px solid #00a32a;
}

.pcf-message.error {
    background: #d63638;
    color: #fff;
    border-left: 4px solid #d63638;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .pcf-frontend-title {
        font-size: 20px;
    }
    
    .pcf-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pcf-type-selector {
        width: 100%;
    }
    
    .pcf-type-selector select {
        flex: 1;
    }
    
    .pcf-actions {
        width: 100%;
    }
    
    .pcf-actions .button {
        flex: 1;
        justify-content: center;
    }
}
