/**
 * Ghostly Labs Components CSS
 * Phantom Realty Engine - UI Components & Elements
 * 
 * Reusable components including cards, buttons, forms and other UI elements.
 * Depends on variables and base styles.
 * 
 * @package PhantomRealtyEngine
 * @subpackage CSS-Components
 * @version 2.0.0
 * @order 03
 * @depends 01-variables.css, 02-base.css
 * @brand Ghostly Labs - Enterprise Real Estate Solutions
 */

/* ================================
   GRADIENT CARDS
   ================================ */

.pre-gradient-dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    border: none;
    border-radius: var(--pre-radius-lg);
    padding: var(--pre-space-md);
    margin-bottom: var(--pre-space-md);
    transition: var(--pre-transition);
    position: relative;
    overflow: hidden;
}

.pre-gradient-primary {
    background: var(--pre-bg-dark);
    color: var(--pre-text-light);
    border: 2px solid var(--pre-primary);
    border-left: 4px solid var(--pre-primary);
    border-radius: var(--pre-radius-lg);
    padding: var(--pre-space-md);
    margin-bottom: var(--pre-space-md);
    transition: var(--pre-transition);
    position: relative;
    overflow: hidden;
}

.pre-gradient-dark:hover,
.pre-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(58, 178, 74, 0.4);
}

/* ================================
   GLASSMORPHIC CARDS
   ================================ */

.pre-card {
    background: var(--pre-glass);
    backdrop-filter: var(--pre-blur);
    border: 1px solid var(--pre-glass-border);
    border-radius: var(--pre-radius-lg);
    padding: var(--pre-space-lg);
    margin-bottom: var(--pre-space-lg);
    transition: var(--pre-transition);
    position: relative;
    overflow: hidden;
}

.pre-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(58, 178, 74, 0.2);
    border-color: rgba(58, 178, 74, 0.3);
}

/* ================================
   BUTTONS SYSTEM
   ================================ */

.pre-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--pre-space-2);
    border: none;
    border-radius: 23px;
    font-family: var(--pre-font);
    font-weight: var(--pre-font-medium);
    font-size: var(--pre-text-sm);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: var(--pre-transition);
    padding: var(--pre-space-3) var(--pre-space-6);
    min-height: 44px;
    min-width: 260px;
    user-select: none;
    white-space: nowrap;
    vertical-align: middle;
}

.pre-button-primary {
    background: #3ab24a;
    color: white;
    box-shadow: 0 4px 15px rgba(58, 178, 74, 0.3);
}

.pre-button-primary:hover {
    background: #4caf50;
    box-shadow: 0 6px 20px rgba(58, 178, 74, 0.4);
    transform: translateY(-2px);
}

.pre-button-secondary {
    background: linear-gradient(135deg, #4caf50 0%, #3ab24a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.pre-button-secondary:hover {
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.pre-button-outline {
    background: transparent;
    color: var(--pre-primary);
    border: 2px solid var(--pre-primary);
    box-shadow: none;
}

.pre-button-outline:hover {
    background: var(--pre-primary);
    color: white;
    box-shadow: 0 2px 10px rgba(58, 178, 74, 0.3);
}

.pre-button-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.pre-button-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* ================================
   FORM INPUT STYLING
   ================================ */

.pre-input {
    background: var(--pre-bg-dark);
    border: 1px solid var(--pre-border);
    color: var(--pre-text);
    border-radius: var(--pre-radius-md);
    padding: 12px 16px;
    width: 100%;
    transition: border-color 0.3s ease;
    font-family: inherit;
    font-size: var(--pre-text-sm);
}

.pre-input:focus {
    border-color: var(--pre-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(58, 178, 74, 0.2);
}

.pre-input::placeholder {
    color: var(--pre-text-dim);
}

/* ================================
   UTILITY CLASSES
   ================================ */

.pre-text-center {
    text-align: center;
}

.pre-text-left {
    text-align: left;
}

.pre-text-right {
    text-align: right;
}

.pre-mb-0 {
    margin-bottom: 0;
}

.pre-mb-1 {
    margin-bottom: var(--pre-space-1);
}

.pre-mb-2 {
    margin-bottom: var(--pre-space-2);
}

.pre-mb-3 {
    margin-bottom: var(--pre-space-3);
}

.pre-mb-4 {
    margin-bottom: var(--pre-space-4);
}

.pre-mb-5 {
    margin-bottom: var(--pre-space-5);
}

.pre-mb-6 {
    margin-bottom: var(--pre-space-6);
}

.pre-mt-0 {
    margin-top: 0;
}

.pre-mt-1 {
    margin-top: var(--pre-space-1);
}

.pre-mt-2 {
    margin-top: var(--pre-space-2);
}

.pre-mt-3 {
    margin-top: var(--pre-space-3);
}

.pre-p-0 {
    padding: 0;
}

.pre-p-1 {
    padding: var(--pre-space-1);
}

.pre-p-2 {
    padding: var(--pre-space-2);
}

.pre-p-3 {
    padding: var(--pre-space-3);
}

.pre-p-4 {
    padding: var(--pre-space-4);
}

/* ================================
   ENTERPRISE CARD STYLES
   ================================ */

/* Enterprise Card Styles */
.pre-stat-card {
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pre-stat-card h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
    opacity: 0.9;
}

.pre-stat-card .stat-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

.pre-stat-card .stat-label {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.pre-integration-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(58, 178, 74, 0.1);
    transition: all 0.3s ease;
}

.pre-integration-card:hover {
    border-color: #3ab24a;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(58, 178, 74, 0.2);
}

/* ================================
   TAB SYSTEM
   ================================ */

/* Tabs */
.pre-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #2a2a2a;
}

.pre-tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.pre-tab:hover {
    color: #3ab24a;
}

.pre-tab.active {
    color: #3ab24a;
}

.pre-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3ab24a;
}

.pre-tab-content {
    position: relative;
}

/* Tab Panes - SCOPED to prevent PowerPack conflicts */
.pre-content-area .pre-tab-pane,
.pre-user-dashboard .pre-tab-pane,
.pre-dashboard .pre-tab-pane {
    display: none;
}

.pre-content-area .pre-tab-pane.active,
.pre-user-dashboard .pre-tab-pane.active,
.pre-dashboard .pre-tab-pane.active {
    display: block;
}

/* ================================
   DEBUG PANEL COMPONENTS
   ================================ */

.pre-button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.pre-debug-container {
    padding: 0;
}

.pre-panel {
    margin-bottom: 30px;
}

.pre-console {
    background: #1e1e1e;
    color: #00ff00;
    padding: 20px;
    border-radius: var(--pre-radius-md);
    font-family: 'Courier New', monospace;
    min-height: 300px;
    border: 1px solid #333;
    overflow-y: auto;
    white-space: pre-wrap;
}

.pre-code-block {
    background: #1e1e1e;
    color: #e0e0e0;
    padding: 15px;
    border-radius: var(--pre-radius-md);
    border: 1px solid #333;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* ================================
   UNIFIED STAT CARDS SYSTEM
   ================================ */

/* WordPress Postbox Stat Cards */
body[class*='pre-realty'] .postbox.stat-card {
    background: var(--pre-bg-card);
    border: 2px solid var(--pre-border);
    border-left: 4px solid var(--pre-green);
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body[class*='pre-realty'] .postbox.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(58, 178, 74, 0.2);
}

body[class*='pre-realty'] .postbox.stat-card .stat-value {
    font-size: 56px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
    margin-bottom: 8px;
}

body[class*='pre-realty'] .postbox.stat-card .stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Legacy Phantom Stat Cards */
.pre-stat-number {
    font-size: var(--pre-stat-number);
    font-weight: 300;
    color: var(--pre-green);
    line-height: 1;
}

.pre-stat-label {
    color: var(--pre-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pre-stat-meta {
    color: rgba(224, 224, 224, 0.7);
}

/* ================================
   STATUS ITEMS SYSTEM
   ================================ */

body[class*='pre-realty'] .status-item,
body[class*='pre-realty'] .pre-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--pre-border);
    color: var(--pre-text);
    font-size: 14px;
}

body[class*='pre-realty'] .status-item:last-child,
body[class*='pre-realty'] .pre-status-item:last-child {
    border-bottom: none;
}

body[class*='pre-realty'] .status-item i,
body[class*='pre-realty'] .pre-status-item i {
    width: 20px;
    text-align: center;
}

body[class*='pre-realty'] .status-item.pre-status-success,
body[class*='pre-realty'] .pre-status-item.pre-status-success {
    color: var(--pre-green);
}

body[class*='pre-realty'] .status-item.pre-status-error,
body[class*='pre-realty'] .pre-status-item.pre-status-error {
    color: var(--pre-error);
}

body[class*='pre-realty'] .status-item.pre-status-warning,
body[class*='pre-realty'] .pre-status-item.pre-status-warning {
    color: var(--pre-warning);
}

/* ================================
   CONFIG FIELDS SYSTEM
   ================================ */

body[class*='pre-realty'] .config-field {
    background: var(--pre-bg-card);
    border: 1px solid var(--pre-border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

body[class*='pre-realty'] .config-field.active {
    border-left: 3px solid var(--pre-green);
    background: linear-gradient(90deg,
            rgba(58, 178, 74, 0.1),
            rgba(58, 178, 74, 0.02));
}

body[class*='pre-realty'] .config-field .field-label {
    font-weight: 600;
    color: var(--pre-text-white);
    margin-bottom: 5px;
}

body[class*='pre-realty'] .config-field .field-value {
    color: var(--pre-text);
    font-family: monospace;
}

/* ================================
   BUTTON SYSTEM (MASTER SOURCE)
   ================================ */

.pre-btn {
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.pre-btn-primary {
    background: linear-gradient(135deg, var(--pre-primary), #2ea040);
    color: white;
    box-shadow: 0 4px 15px rgba(58, 178, 74, 0.3);
}

.pre-btn-primary:hover {
    background: linear-gradient(135deg, #2ea040, #259a36);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(58, 178, 74, 0.4);
}

.pre-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pre-text-light);
    border: 1px solid rgba(58, 178, 74, 0.3);
}

.pre-btn-secondary:hover {
    background: rgba(58, 178, 74, 0.1);
    border-color: rgba(58, 178, 74, 0.5);
    color: var(--pre-text-light);
}

.pre-btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.pre-btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.pre-btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.pre-btn-large {
    padding: 20px 40px;
    font-size: 16px;
}

/* ================================
   SEARCH FORM CONTAINERS
   ================================ */

/* Base search form container */
.phantom-search-form-container {
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

/* Container styling for standalone usage */
.phantom-search-form-container.has-container-styling {
    border-radius: var(--pre-radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--pre-transition);
}

/* Container types for different contexts */
.phantom-search-form-container.container-card {
    background: var(--pre-bg-white);
    border: 1px solid var(--pre-border-light);
    padding: var(--pre-space-lg);
    margin: var(--pre-space-md) 0;
}

.phantom-search-form-container.container-section {
    background: var(--pre-bg-light);
    padding: var(--pre-space-xl);
    margin: var(--pre-space-lg) 0;
}

.phantom-search-form-container.container-hero {
    background: linear-gradient(135deg, var(--pre-primary) 0%, var(--pre-accent) 100%);
    color: white;
    padding: var(--pre-space-xxl);
    margin: var(--pre-space-lg) 0;
    text-align: center;
}

.phantom-search-form-container.container-minimal {
    background: transparent;
    padding: var(--pre-space-md);
    border: none;
    box-shadow: none;
}

/* Dark theme containers */
.phantom-search-form-container.theme-dark.has-container-styling {
    background: var(--pre-bg-dark);
    color: var(--pre-text-light);
    border: 1px solid var(--pre-border-dark);
}

/* Hover effects for styled containers */
.phantom-search-form-container.has-container-styling:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(58, 178, 74, 0.2);
}

/* Responsive container adjustments */
@media (max-width: 768px) {
    .phantom-search-form-container.container-section,
    .phantom-search-form-container.container-hero {
        padding: var(--pre-space-lg);
        margin: var(--pre-space-md) 0;
    }
}