/**
 * SmartHome Configurator - Frontend Styles
 *
 * Responzívny dizajn pre konfigurátor (mobile-first)
 */

/* ===================================
   Variables & Reset
   =================================== */
:root {
    --sh-primary: #2563eb;
    --sh-primary-dark: #1d4ed8;
    --sh-primary-light: #3b82f6;
    --sh-secondary: #64748b;
    --sh-success: #10b981;
    --sh-danger: #ef4444;
    --sh-warning: #f59e0b;

    --sh-bg-light: #f8fafc;
    --sh-bg-white: #ffffff;
    --sh-border: #e2e8f0;
    --sh-text: #1e293b;
    --sh-text-muted: #64748b;

    --sh-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --sh-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --sh-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --sh-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    --sh-radius: 8px;
    --sh-radius-lg: 12px;
    --sh-transition: all 0.2s ease;
}

/* ===================================
   Container
   =================================== */
.smarthome-configurator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--sh-text);
}

/* ===================================
   Progress Bar
   =================================== */
.smarthome-progress {
    margin-bottom: 40px;
}

.smarthome-progress-bar {
    height: 8px;
    background: var(--sh-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
}

.smarthome-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sh-primary), var(--sh-primary-light));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.smarthome-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.smarthome-step {
    flex: 1;
    text-align: center;
    transition: var(--sh-transition);
}

.smarthome-step .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sh-bg-light);
    border: 2px solid var(--sh-border);
    color: var(--sh-text-muted);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    transition: var(--sh-transition);
}

.smarthome-step .step-label {
    display: block;
    font-size: 13px;
    color: var(--sh-text-muted);
    font-weight: 500;
}

.smarthome-step.active .step-number {
    background: var(--sh-primary);
    border-color: var(--sh-primary);
    color: white;
}

.smarthome-step.active .step-label {
    color: var(--sh-primary);
    font-weight: 600;
}

.smarthome-step.completed .step-number {
    background: var(--sh-success);
    border-color: var(--sh-success);
    color: white;
}

.smarthome-step.completed .step-number::before {
    content: '✓';
}

/* ===================================
   Wizard Container
   =================================== */
.smarthome-wizard {
    background: var(--sh-bg-white);
    border-radius: var(--sh-radius-lg);
    box-shadow: var(--sh-shadow-md);
    padding: 32px;
    margin-bottom: 24px;
    min-height: 500px;
}

.smarthome-wizard-step {
    display: none;
}

.smarthome-wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smarthome-step-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--sh-text);
    margin-bottom: 12px;
}

.smarthome-step-description {
    color: var(--sh-text-muted);
    font-size: 16px;
    margin-bottom: 32px;
}

/* ===================================
   Forms
   =================================== */
.smarthome-form {
    max-width: 600px;
}

.smarthome-form-group {
    margin-bottom: 24px;
}

.smarthome-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--sh-text);
    font-size: 14px;
}

.smarthome-form-group input[type="text"],
.smarthome-form-group textarea,
.smarthome-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    font-size: 15px;
    transition: var(--sh-transition);
    font-family: inherit;
}

.smarthome-form-group input[type="text"]:focus,
.smarthome-form-group textarea:focus,
.smarthome-form-group select:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.smarthome-form-help {
    display: block;
    font-size: 13px;
    color: var(--sh-text-muted);
    margin-top: 6px;
}

.smarthome-form-inline {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.smarthome-form-inline input,
.smarthome-form-inline select {
    flex: 1;
}

/* ===================================
   Platform Selector
   =================================== */
.smarthome-platform-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.smarthome-platform-option {
    padding: 32px 24px;
    border: 3px solid var(--sh-border);
    border-radius: var(--sh-radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--sh-transition);
    background: var(--sh-bg-white);
}

.smarthome-platform-option:hover {
    border-color: var(--sh-primary-light);
    box-shadow: var(--sh-shadow-md);
    transform: translateY(-2px);
}

.smarthome-platform-option.selected {
    border-color: var(--sh-primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: var(--sh-shadow-lg);
}

.smarthome-platform-option .platform-icon {
    margin-bottom: 16px;
    color: var(--sh-text-muted);
}

.smarthome-platform-option.selected .platform-icon {
    color: var(--sh-primary);
}

.smarthome-platform-option h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--sh-text);
}

.smarthome-platform-option p {
    color: var(--sh-text-muted);
    font-size: 14px;
}

/* ===================================
   Rooms
   =================================== */
.smarthome-rooms-container {
    max-width: 700px;
}

.smarthome-add-room-form {
    margin-bottom: 24px;
}

.room-name-input,
.room-type-select {
    padding: 12px 16px;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    font-size: 15px;
}

.smarthome-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--sh-bg-light);
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    transition: var(--sh-transition);
}

.room-item:hover {
    border-color: var(--sh-primary-light);
    box-shadow: var(--sh-shadow);
}

.room-info strong {
    display: block;
    font-size: 16px;
    color: var(--sh-text);
    margin-bottom: 4px;
}

.room-info small {
    color: var(--sh-text-muted);
    font-size: 13px;
}

.no-rooms {
    padding: 40px;
    text-align: center;
    color: var(--sh-text-muted);
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    border: 2px dashed var(--sh-border);
}

/* ===================================
   Devices Layout
   =================================== */
.smarthome-devices-layout {
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 24px;
    margin-top: 24px;
}

/* Device Categories */
.smarthome-device-categories h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    padding: 12px 16px;
    background: var(--sh-bg-light);
    border: 2px solid transparent;
    border-radius: var(--sh-radius);
    text-align: left;
    cursor: pointer;
    transition: var(--sh-transition);
    font-size: 14px;
    font-weight: 500;
}

.category-item:hover {
    background: var(--sh-border);
}

.category-item.active {
    background: var(--sh-primary);
    color: white;
    border-color: var(--sh-primary);
}

/* Device Catalog */
.smarthome-device-catalog {
    flex: 1;
}

.catalog-header {
    margin-bottom: 20px;
}

.catalog-header input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    font-size: 15px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.catalog-grid::-webkit-scrollbar {
    width: 8px;
}

.catalog-grid::-webkit-scrollbar-track {
    background: var(--sh-bg-light);
    border-radius: 4px;
}

.catalog-grid::-webkit-scrollbar-thumb {
    background: var(--sh-border);
    border-radius: 4px;
}

.catalog-grid::-webkit-scrollbar-thumb:hover {
    background: var(--sh-secondary);
}

.device-card {
    background: var(--sh-bg-white);
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 16px;
    transition: var(--sh-transition);
    display: flex;
    flex-direction: column;
}

.device-card:hover {
    border-color: var(--sh-primary-light);
    box-shadow: var(--sh-shadow-md);
    transform: translateY(-2px);
}

.device-card-header {
    margin-bottom: 12px;
}

.device-card-header h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--sh-text);
}

.device-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--sh-primary);
}

.device-card-body {
    flex: 1;
    margin-bottom: 12px;
}

.device-description {
    font-size: 13px;
    color: var(--sh-text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.device-category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--sh-bg-light);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sh-text-muted);
    text-transform: uppercase;
}

.device-card-footer {
    margin-top: auto;
}

.catalog-loading,
.no-devices {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--sh-text-muted);
}

/* Selected Devices */
.smarthome-selected-devices {
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    padding: 20px;
}

.smarthome-selected-devices h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.selected-devices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.selected-device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--sh-bg-white);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow-sm);
}

.device-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.device-info small {
    font-size: 12px;
    color: var(--sh-text-muted);
}

/* ===================================
   Summary
   =================================== */
.smarthome-summary {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.summary-section {
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    padding: 24px;
}

.summary-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--sh-text);
}

.summary-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 24px;
}

.summary-details dt {
    font-weight: 600;
    color: var(--sh-text-muted);
}

.summary-details dd {
    margin: 0;
    color: var(--sh-text);
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item {
    padding: 8px 0;
    color: var(--sh-text);
    font-size: 14px;
}

.summary-room-header {
    font-weight: 700;
    color: var(--sh-text);
    margin-top: 12px;
    margin-bottom: 4px;
}

/* Price Breakdown */
.summary-pricing {
    background: linear-gradient(135deg, var(--sh-primary-light), var(--sh-primary));
    color: white;
}

.summary-pricing h3 {
    color: white;
}

.price-breakdown {
    margin-bottom: 16px;
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.price-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 20px;
    font-weight: 700;
}

.price-amount {
    font-size: 28px;
}

.price-loading,
.price-error {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
}

/* ===================================
   Buttons
   =================================== */
.smarthome-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--sh-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--sh-transition);
    font-family: inherit;
}

.smarthome-btn-primary {
    background: var(--sh-primary);
    color: white;
}

.smarthome-btn-primary:hover {
    background: var(--sh-primary-dark);
    box-shadow: var(--sh-shadow-md);
}

.smarthome-btn-secondary {
    background: var(--sh-secondary);
    color: white;
}

.smarthome-btn-secondary:hover {
    background: #475569;
}

.smarthome-btn-success {
    background: var(--sh-success);
    color: white;
}

.smarthome-btn-success:hover {
    background: #059669;
}

.smarthome-btn-danger {
    background: var(--sh-danger);
    color: white;
}

.smarthome-btn-danger:hover {
    background: #dc2626;
}

.smarthome-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Navigation Buttons */
.smarthome-wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.smarthome-wizard-nav .smarthome-btn {
    flex: 0 0 auto;
}

/* ===================================
   Loading Overlay
   =================================== */
.smarthome-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.smarthome-loading-overlay p {
    color: white;
    margin-top: 16px;
    font-size: 16px;
    font-weight: 600;
}

/* ===================================
   Notifications
   =================================== */
.smarthome-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow-lg);
    z-index: 10000;
    font-weight: 600;
}

.smarthome-notification.success {
    background: var(--sh-success);
    color: white;
}

.smarthome-notification.error {
    background: var(--sh-danger);
    color: white;
}

/* ===================================
   Drag & Drop Styles
   =================================== */

/* Draggable elements */
.room-item.draggable {
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.room-item.draggable:hover {
    box-shadow: var(--sh-shadow-md);
    transform: translateY(-2px);
}

.room-item.is-dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.room-ghost {
    pointer-events: none;
    box-shadow: var(--sh-shadow-lg);
    transform: rotate(3deg);
}

/* Drop zones */
.room-dropzone {
    padding: 20px;
    border: 3px dashed transparent;
    border-radius: var(--sh-radius);
    transition: var(--sh-transition);
    min-height: 80px;
    margin-bottom: 12px;
}

.room-dropzone.active {
    border-color: var(--sh-border);
    background: var(--sh-bg-light);
}

.room-dropzone.hover {
    border-color: var(--sh-primary);
    background: rgba(37, 99, 235, 0.1);
}

.room-dropzone.drop-success {
    border-color: var(--sh-success);
    background: rgba(16, 185, 129, 0.1);
    animation: dropSuccess 0.5s ease;
}

@keyframes dropSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

body.room-dragging-active {
    cursor: grabbing !important;
}

body.room-dragging-active * {
    cursor: grabbing !important;
}

/* ===================================
   Floor Plan Visualizer
   =================================== */
.floor-plan-container {
    margin: 32px 0;
    position: relative;
}

.floor-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.floor-plan-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--sh-text);
}

.floor-plan-controls {
    display: flex;
    gap: 8px;
}

.floor-plan-svg {
    width: 100%;
    height: 600px;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    background: #ffffff;
    cursor: default;
}

.room-svg-element {
    transition: opacity 0.2s ease;
}

.room-svg-element:hover rect {
    opacity: 0.9;
    stroke-width: 3;
}

.room-svg-element.selected rect {
    stroke-width: 4;
    stroke: var(--sh-primary);
}

/* Floor plan toolbar */
.floor-plan-toolbar {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    margin-bottom: 16px;
}

.floor-plan-tool {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    cursor: pointer;
    transition: var(--sh-transition);
    font-size: 13px;
    font-weight: 600;
}

.floor-plan-tool:hover {
    border-color: var(--sh-primary);
    color: var(--sh-primary);
}

.floor-plan-tool.active {
    background: var(--sh-primary);
    border-color: var(--sh-primary);
    color: white;
}

/* Room properties panel */
.room-properties-panel {
    position: absolute;
    right: 20px;
    top: 80px;
    width: 280px;
    background: white;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 20px;
    box-shadow: var(--sh-shadow-lg);
    display: none;
}

.room-properties-panel.active {
    display: block;
}

.room-properties-panel h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.room-property {
    margin-bottom: 12px;
}

.room-property label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--sh-text-muted);
}

.room-property input,
.room-property select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    font-size: 14px;
}

/* Grid controls */
.grid-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    margin-bottom: 16px;
}

.grid-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.grid-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.snap-to-grid {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet */
@media (max-width: 992px) {
    .smarthome-devices-layout {
        grid-template-columns: 1fr;
    }

    .smarthome-device-categories {
        order: -1;
    }

    .category-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .smarthome-selected-devices {
        max-height: 300px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .smarthome-configurator {
        padding: 12px;
    }

    .smarthome-wizard {
        padding: 20px;
    }

    .smarthome-step-content h2 {
        font-size: 22px;
    }

    .smarthome-step-description {
        font-size: 14px;
    }

    .smarthome-progress-steps {
        gap: 4px;
    }

    .smarthome-step .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .smarthome-step .step-label {
        font-size: 11px;
    }

    .smarthome-platform-selector {
        grid-template-columns: 1fr;
    }

    .smarthome-form-inline {
        flex-direction: column;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .smarthome-wizard-nav {
        flex-direction: column-reverse;
    }

    .smarthome-wizard-nav .smarthome-btn {
        width: 100%;
    }

    .summary-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* ===================================
   Tooltips
   =================================== */
.smarthome-tooltip {
    position: absolute;
    z-index: 10001;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.smarthome-tooltip.show {
    opacity: 1;
}

.tooltip-inner {
    background: var(--sh-text);
    color: white;
    padding: 12px 16px;
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow-lg);
}

.tooltip-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14px;
}

.tooltip-content {
    font-size: 13px;
    line-height: 1.5;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.smarthome-tooltip.top .tooltip-arrow {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-color: var(--sh-text) transparent transparent transparent;
}

.smarthome-tooltip.bottom .tooltip-arrow {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent var(--sh-text) transparent;
}

.smarthome-tooltip.left .tooltip-arrow {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent var(--sh-text);
}

.smarthome-tooltip.right .tooltip-arrow {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent var(--sh-text) transparent transparent;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--sh-border);
    cursor: help;
    font-size: 12px;
    margin-left: 6px;
    transition: var(--sh-transition);
}

.help-icon:hover {
    background: var(--sh-primary);
    color: white;
}

/* ===================================
   Credentials Form
   =================================== */
.credentials-form {
    max-width: 800px;
    margin: 0 auto;
}

.credentials-section {
    background: var(--sh-bg-light);
    padding: 24px;
    border-radius: var(--sh-radius);
    margin-bottom: 20px;
}

.credentials-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--sh-text);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--sh-text);
}

.form-field input,
.form-field select {
    padding: 10px 14px;
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    font-size: 14px;
    transition: var(--sh-transition);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--sh-primary);
}

.password-input-group {
    display: flex;
    gap: 8px;
}

.password-input-group input {
    flex: 1;
}

.password-input-group button {
    padding: 10px 14px;
    background: var(--sh-bg-light);
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    cursor: pointer;
    transition: var(--sh-transition);
    font-size: 16px;
}

.password-input-group button:hover {
    background: var(--sh-border);
}

.credentials-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--sh-radius);
    border: 2px solid rgba(37, 99, 235, 0.2);
}

.notice-icon {
    font-size: 20px;
}

.credentials-notice p {
    margin: 0;
    font-size: 14px;
    color: var(--sh-text-muted);
}

/* ===================================
   Geo Location Picker
   =================================== */
.geo-location-picker {
    max-width: 900px;
    margin: 0 auto;
}

.location-input-section {
    background: var(--sh-bg-light);
    padding: 24px;
    border-radius: var(--sh-radius);
    margin-bottom: 20px;
}

.location-search-group {
    display: flex;
    gap: 8px;
}

.location-search-group input {
    flex: 1;
}

.location-map-container {
    margin: 20px 0;
}

.location-info {
    padding: 16px;
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    margin-top: 20px;
}

.location-info p {
    margin: 8px 0;
    font-size: 14px;
}

.help-text {
    color: var(--sh-text-muted);
    font-size: 13px;
}

/* ===================================
   Connection Type Selector
   =================================== */
.connection-type-selector {
    max-width: 900px;
    margin: 0 auto;
}

.connection-type-selector h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.connection-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.connection-option {
    padding: 24px;
    background: var(--sh-bg-white);
    border: 3px solid var(--sh-border);
    border-radius: var(--sh-radius);
    cursor: pointer;
    transition: var(--sh-transition);
    text-align: center;
}

.connection-option:hover {
    border-color: var(--sh-primary-light);
    box-shadow: var(--sh-shadow-md);
}

.connection-option.selected {
    border-color: var(--sh-primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: var(--sh-shadow-lg);
}

.option-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.connection-option h5 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.connection-option p {
    font-size: 14px;
    color: var(--sh-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.option-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.feature-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--sh-bg-light);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sh-text-muted);
}

.connection-option.selected .feature-badge {
    background: rgba(37, 99, 235, 0.15);
    color: var(--sh-primary);
}

.additional-options {
    padding: 20px;
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 15px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ===================================
   Validation Modal
   =================================== */
.validation-modal .modal-body {
    max-width: 600px;
}

.validation-errors,
.validation-warnings {
    margin-bottom: 20px;
}

.validation-errors h4,
.validation-warnings h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.validation-item {
    padding: 16px;
    border-radius: var(--sh-radius);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.validation-item.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.validation-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.validation-item p {
    margin: 0;
    flex: 1;
    font-size: 14px;
}

.validation-action-btn {
    padding: 8px 16px;
    background: var(--sh-primary);
    color: white;
    border: none;
    border-radius: var(--sh-radius);
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

/* ===================================
   Upselling Modal
   =================================== */
.upselling-modal .modal-body {
    display: grid;
    gap: 20px;
}

.upsell-card {
    padding: 24px;
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    border: 2px solid var(--sh-border);
    position: relative;
}

.upsell-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    padding: 6px 16px;
    background: var(--sh-primary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.upsell-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.upsell-card p {
    font-size: 14px;
    color: var(--sh-text-muted);
    margin-bottom: 16px;
}

.upsell-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.upsell-benefits li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--sh-text);
}

.upsell-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--sh-primary);
    margin-bottom: 16px;
}

/* ===================================
   Modal Styles
   =================================== */
.smarthome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.smarthome-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.smarthome-modal-content {
    position: relative;
    max-width: 800px;
    margin: 50px auto;
    background: white;
    border-radius: var(--sh-radius-lg);
    box-shadow: var(--sh-shadow-lg);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.smarthome-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: var(--sh-bg-light);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: var(--sh-transition);
    z-index: 1;
}

.smarthome-modal-close:hover {
    background: var(--sh-border);
}

.modal-header {
    padding: 32px;
    border-bottom: 2px solid var(--sh-border);
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--sh-text-muted);
    margin: 0;
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 2px solid var(--sh-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Small mobile */
@media (max-width: 480px) {
    .smarthome-wizard {
        padding: 16px;
    }

    .smarthome-step-content h2 {
        font-size: 20px;
    }

    .smarthome-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .connection-options,
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Phase 3.2: Automation Builder
   =================================== */

/* Automation Builder Container */
.automation-builder {
    background: var(--sh-bg-white);
    border-radius: var(--sh-radius-lg);
    box-shadow: var(--sh-shadow);
    padding: 30px;
}

.automation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--sh-border);
}

.automation-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--sh-text);
}

/* Automation Content Layout */
.automation-content {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 30px;
    min-height: 600px;
}

/* Left Panel: Templates */
.automation-templates {
    border-right: 1px solid var(--sh-border);
    padding-right: 20px;
}

.automation-templates h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--sh-text);
}

.template-categories {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
}

.template-filter {
    background: transparent;
    border: 1px solid var(--sh-border);
    padding: 8px 12px;
    border-radius: var(--sh-radius);
    text-align: left;
    cursor: pointer;
    transition: var(--sh-transition);
    font-size: 14px;
}

.template-filter:hover {
    background: var(--sh-bg-light);
}

.template-filter.active {
    background: var(--sh-primary);
    color: white;
    border-color: var(--sh-primary);
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.template-card {
    background: var(--sh-bg-light);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 15px;
    cursor: pointer;
    transition: var(--sh-transition);
}

.template-card:hover {
    box-shadow: var(--sh-shadow-md);
    transform: translateY(-2px);
}

.template-icon {
    width: 40px;
    height: 40px;
    background: var(--sh-primary-light);
    border-radius: var(--sh-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.template-icon .dashicons {
    color: white;
    font-size: 24px;
}

.template-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--sh-text);
}

.template-card p {
    font-size: 12px;
    color: var(--sh-text-muted);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.template-meta .badge {
    background: var(--sh-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.template-meta .price {
    font-weight: 600;
    color: var(--sh-primary);
    font-size: 14px;
}

.use-template-btn {
    width: 100%;
    padding: 8px;
    font-size: 13px;
}

/* Center Panel: Functionality List */
.automation-list {
    padding: 0 20px;
}

.automation-list h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--sh-text);
}

.functionality-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.functionality-item {
    background: var(--sh-bg-white);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 15px;
    cursor: pointer;
    transition: var(--sh-transition);
}

.functionality-item:hover {
    box-shadow: var(--sh-shadow-md);
    border-color: var(--sh-primary-light);
}

.functionality-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.functionality-icon {
    width: 40px;
    height: 40px;
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.functionality-icon .dashicons {
    color: var(--sh-primary);
    font-size: 24px;
}

.functionality-info {
    flex: 1;
}

.functionality-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--sh-text);
}

.functionality-trigger {
    font-size: 13px;
    color: var(--sh-text-muted);
    margin: 0;
}

.functionality-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--sh-transition);
}

.btn-icon:hover {
    opacity: 1;
}

.btn-icon .dashicons {
    font-size: 18px;
}

.btn-edit-functionality .dashicons {
    color: var(--sh-primary);
}

.btn-delete-functionality .dashicons {
    color: var(--sh-danger);
}

.functionality-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--sh-text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item .dashicons {
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--sh-text-muted);
}

.empty-state .dashicons {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 15px;
}

.empty-state p {
    margin: 5px 0;
}

.empty-state .hint {
    font-size: 13px;
    opacity: 0.7;
}

/* Right Panel: Preview */
.automation-preview {
    border-left: 1px solid var(--sh-border);
    padding-left: 20px;
}

.automation-preview h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--sh-text);
}

.preview-content {
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    padding: 20px;
}

.preview-content .hint {
    text-align: center;
    color: var(--sh-text-muted);
    font-size: 14px;
}

.functionality-details h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--sh-text);
}

.functionality-details .description {
    color: var(--sh-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--sh-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section ul,
.detail-section ol {
    margin: 0;
    padding-left: 20px;
}

.detail-section li {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.5;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--sh-success);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Automation Modal */
.automation-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.automation-modal-content {
    position: relative;
    background-color: var(--sh-bg-white);
    margin: 2% auto;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: var(--sh-radius-lg);
    box-shadow: var(--sh-shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--sh-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--sh-text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--sh-transition);
}

.modal-close:hover {
    background: var(--sh-bg-light);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--sh-border);
}

/* Wizard */
.automation-wizard {
    min-height: 400px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-step h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--sh-text);
}

.wizard-step .hint {
    color: var(--sh-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--sh-text);
    font-size: 14px;
}

.form-group label .required {
    color: var(--sh-danger);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    font-size: 14px;
    transition: var(--sh-transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--sh-border);
    outline: none;
}

.form-control-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sh-primary);
    cursor: pointer;
}

.form-control-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sh-primary);
    cursor: pointer;
    border: none;
}

.range-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
    color: var(--sh-primary);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--sh-text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Trigger Type Cards */
.trigger-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.trigger-type-card {
    background: var(--sh-bg-light);
    border: 2px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--sh-transition);
}

.trigger-type-card:hover {
    border-color: var(--sh-primary-light);
    box-shadow: var(--sh-shadow-md);
}

.trigger-type-card.selected {
    background: var(--sh-primary);
    border-color: var(--sh-primary);
    color: white;
}

.trigger-type-card .dashicons {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--sh-primary);
}

.trigger-type-card.selected .dashicons {
    color: white;
}

.trigger-type-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.trigger-type-card p {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.trigger-config {
    margin-top: 20px;
}

/* Day Selector */
.day-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.day-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--sh-bg-light);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    cursor: pointer;
    font-size: 13px;
    transition: var(--sh-transition);
}

.day-checkbox:hover {
    border-color: var(--sh-primary);
}

.day-checkbox input {
    margin-right: 6px;
}

.day-checkbox input:checked + label,
.day-checkbox:has(input:checked) {
    background: var(--sh-primary);
    color: white;
    border-color: var(--sh-primary);
}

/* Conditions & Actions */
.conditions-list,
.actions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.condition-item,
.action-item {
    background: var(--sh-bg-light);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 15px;
    position: relative;
}

.action-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.action-number {
    width: 28px;
    height: 28px;
    background: var(--sh-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.action-header .action-type,
.condition-item .condition-type {
    flex: 1;
}

.btn-remove-condition,
.btn-remove-action {
    background: var(--sh-danger);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--sh-transition);
    flex-shrink: 0;
}

.btn-remove-condition:hover,
.btn-remove-action:hover {
    background: #dc2626;
}

.btn-remove-condition .dashicons,
.btn-remove-action .dashicons {
    font-size: 16px;
}

.condition-config,
.action-config {
    margin-top: 15px;
}

.action-params {
    margin-top: 15px;
}

/* Notification Types */
.notification-types {
    display: flex;
    gap: 20px;
}

.notification-types label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}

/* Review */
.automation-review {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.review-section {
    background: var(--sh-bg-light);
    border-radius: var(--sh-radius);
    padding: 20px;
}

.review-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--sh-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--sh-border);
}

.review-section dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px 20px;
    margin: 0;
}

.review-section dt {
    font-weight: 600;
    color: var(--sh-text-muted);
    font-size: 13px;
}

.review-section dd {
    margin: 0;
    color: var(--sh-text);
    font-size: 14px;
}

.review-section .price {
    font-size: 18px;
    font-weight: 600;
    color: var(--sh-primary);
}

.review-list {
    margin: 0;
    padding-left: 20px;
}

.review-list li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

/* Wizard Navigation */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.wizard-steps-indicator {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sh-border);
    transition: var(--sh-transition);
    cursor: pointer;
}

.step-dot.completed {
    background: var(--sh-success);
}

.step-dot.active {
    background: var(--sh-primary);
    width: 30px;
    border-radius: 5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--sh-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--sh-transition);
    text-decoration: none;
    line-height: 1;
}

.btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--sh-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--sh-primary-dark);
}

.btn-secondary {
    background: var(--sh-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: var(--sh-success);
    color: white;
}

.badge-secondary {
    background: var(--sh-secondary);
    color: white;
}

/* Notification */
.smarthome-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow-lg);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 300px;
}

.smarthome-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.smarthome-notification.success {
    border-left: 4px solid var(--sh-success);
}

.smarthome-notification.info {
    border-left: 4px solid var(--sh-primary);
}

.smarthome-notification.error {
    border-left: 4px solid var(--sh-danger);
}

/* Responsive */
@media (max-width: 1200px) {
    .automation-content {
        grid-template-columns: 1fr;
    }

    .automation-templates,
    .automation-preview {
        border: none;
        padding: 0;
    }

    .automation-templates {
        max-width: 100%;
    }

    .template-categories {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .template-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .automation-builder {
        padding: 20px;
    }

    .automation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .automation-modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .trigger-type-grid {
        grid-template-columns: 1fr;
    }

    .inline-fields {
        grid-template-columns: 1fr;
    }

    .review-section dl {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .wizard-navigation {
        flex-wrap: wrap;
    }

    .wizard-steps-indicator {
        order: -1;
        width: 100%;
        margin-bottom: 15px;
    }
}
