/**
 * Admin Styles: Form Builder and Entries Dashboard
 *
 * This file provides the visual styling for the 24TT Unrestricted Forms backend.
 * It is designed to be lightweight and blend seamlessly with the native WP Admin.
 *
 * @package    24TT_Unrestricted_Forms
 * @since      1.0.0
 * Contributors: 24techtime, johniouspatriot
 */

/* ==========================================================================
   1. General Builder Wrapper
   ========================================================================== */
.tt24-builder-wrap {
    max-width: 1200px;
    /* Keeps the builder contained on massive screens */
    margin-top: 20px;
}

.tt24-builder-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* Title Input Styling */
.tt24-title-input-wrapper {
    flex-grow: 1;
    margin-right: 20px;
}

#tt24-form-title {
    font-size: 20px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #8c8f94;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#tt24-form-title:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Save Button */
#tt24-save-form-btn {
    font-size: 15px;
    padding: 6px 24px;
}

/* ==========================================================================
   2. Main Layout (CSS Grid/Flexbox)
   ========================================================================== */
.tt24-builder-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.tt24-builder-canvas-area,
.tt24-builder-sidebar {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   3. The Sidebar & Tabs
   ========================================================================== */
.tt24-sidebar-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #f0f0f1;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tt24-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    color: #646970;
    transition: all 0.2s ease;
    margin-bottom: -12px;
    /* Pulls the border down to overlap the container border */
}

.tt24-tab-btn:hover {
    color: #2271b1;
}

.tt24-tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.tt24-tab-content {
    animation: tt24FadeIn 0.3s ease;
}

@keyframes tt24FadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Standard Field Buttons */
.tt24-draggable-field {
    width: 100%;
    text-align: left;
    padding: 10px;
    background: #f6f7f7;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    cursor: grab;
    transition: background 0.2s, border-color 0.2s;
}

.tt24-draggable-field:hover {
    background: #fff;
    border-color: #2271b1;
    color: #2271b1;
}

.tt24-draggable-field:active {
    cursor: grabbing;
}

/* ==========================================================================
   4. The Canvas (Drop Zone)
   ========================================================================== */
#tt24-drop-zone {
    min-height: 400px;
    border: 2px dashed #b4b9be;
    border-radius: 4px;
    padding: 20px;
    background: #f9f9f9;
    transition: background 0.3s ease;
}

.tt24-canvas-field {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #2271b1;
    /* Blue accent edge to show it's a field */
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tt24-canvas-field:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tt24-field-label-display {
    font-size: 14px;
    color: #1d2327;
}

.tt24-field-input-mock {
    width: 100%;
    max-width: 400px;
    background: #f0f0f1;
    border: 1px solid #8c8f94;
    padding: 8px 12px;
    border-radius: 3px;
    color: #646970;
    margin-top: 5px;
    cursor: not-allowed;
    /* Shows it's a preview, not a real input */
}

.tt24-remove-field {
    background: #fff;
    color: #d63638;
    border: 1px solid #d63638;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tt24-remove-field:hover {
    background: #d63638;
    color: #fff;
}

/* ==========================================================================
   5. Entries Dashboard Overrides
   ========================================================================== */
.tt24-entries-wrap .wp-list-table {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.tt24-entries-wrap th {
    font-weight: 600;
    background: #f6f7f7;
}