/**
 * HDS Postcode Search Widget Styles
 */

.hds-ps-widget {
    --widget-color: #dc3232;
    --widget-vertical-position: 50%;
    --widget-edge-distance: 0px;
    position: fixed;
    top: var(--widget-vertical-position);
    transform: translateY(-50%);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.hds-ps-widget.hds-ps-position-right {
    right: var(--widget-edge-distance);
}

.hds-ps-widget.hds-ps-position-left {
    left: var(--widget-edge-distance);
}

/* Floating Tab */
.hds-ps-tab {
    background: var(--widget-color);
    color: #fff;
    padding: 15px;
    cursor: pointer;
    border-radius: 10px 0 0 10px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 40px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hds-ps-position-left .hds-ps-tab {
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

.hds-ps-tab:hover {
    padding-right: 20px;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.3);
}

.hds-ps-position-left .hds-ps-tab:hover {
    padding-left: 20px;
    padding-right: 15px;
}

.hds-ps-tab-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Search Panel - Transform-based (starts hidden off-screen) */
.hds-ps-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    transform: translateX(100%);
    overflow-y: auto;
    z-index: 1000000;
}

.hds-ps-position-left .hds-ps-panel {
    right: auto;
    left: 0;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
}

.hds-ps-panel.hds-ps-open {
    transform: translateX(0);
}

.hds-ps-panel-header {
    background: var(--widget-color);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hds-ps-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.hds-ps-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    transition: transform 0.2s;
}

.hds-ps-close:hover {
    transform: scale(1.2);
}

.hds-ps-panel-content {
    padding: 25px;
}

/* Form Styles */
.hds-ps-form-group {
    margin-bottom: 20px;
}

.hds-ps-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.hds-ps-form-group input[type="text"],
.hds-ps-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.hds-ps-form-group input[type="text"]:focus,
.hds-ps-form-group select:focus {
    outline: none;
    border-color: var(--widget-color);
}

.hds-ps-button {
    width: 100%;
    background: var(--widget-color);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.hds-ps-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hds-ps-button:active {
    transform: translateY(0);
}

/* Loading Spinner */
.hds-ps-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.hds-ps-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--widget-color);
    border-radius: 50%;
    animation: hds-ps-spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes hds-ps-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Styles */
.hds-ps-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    animation: hds-ps-fadein 0.3s;
}

@keyframes hds-ps-fadein {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hds-ps-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
}

.hds-ps-success strong {
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.hds-ps-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
}

/* Notification Registration Modal */
.hds-ps-notify-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000000;
    animation: hds-ps-fadein 0.3s;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.hds-ps-notify-modal.hds-ps-modal-open {
    display: flex;
}

.hds-ps-notify-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: hds-ps-slide-up 0.4s ease-out;
    overflow: hidden;
}

@keyframes hds-ps-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hds-ps-notify-header {
    padding: 35px 30px 25px;
    text-align: center;
    color: #fff;
    position: relative;
}

.hds-ps-notify-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 32px;
}

.hds-ps-notify-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.hds-ps-notify-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: hds-ps-bounce 1s infinite;
}

@keyframes hds-ps-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hds-ps-notify-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hds-ps-notify-message {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.hds-ps-notify-offer {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    margin: 20px 30px 0;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hds-ps-notify-offer-text {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.hds-ps-notify-form {
    background: #fff;
    padding: 30px;
}

.hds-ps-notify-form-group {
    margin-bottom: 18px;
}

.hds-ps-notify-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.hds-ps-notify-form-group input[type="text"],
.hds-ps-notify-form-group input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.hds-ps-notify-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.hds-ps-notify-submit {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.hds-ps-notify-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.hds-ps-notify-submit:active {
    transform: translateY(0);
}

.hds-ps-notify-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hds-ps-notify-success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
}

.hds-ps-notify-error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
}

.hds-ps-notify-location {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* Mobile Responsive - panels slide up from bottom */
@media (max-width: 480px) {
    /* Remove transform from widget container so panel can be properly fixed */
    /* Use mobile-specific vertical position setting for button placement */
    .hds-ps-widget {
        top: var(--widget-vertical-position-mobile);
        transform: none;
    }
    
    /* Make button smaller on mobile */
    .hds-ps-tab {
        padding: 10px 8px;
        min-width: 32px;
        min-height: 80px;
        border-radius: 8px 0 0 8px;
    }
    
    .hds-ps-position-left .hds-ps-tab {
        border-radius: 0 8px 8px 0;
    }
    
    .hds-ps-tab-text {
        font-size: 13px;
        letter-spacing: 0.5px;
    }
    
    /* No hover expansion on mobile */
    .hds-ps-tab:hover,
    .hds-ps-position-left .hds-ps-tab:hover {
        padding: 10px 8px;
    }
    
    /* Search panel slides up from bottom on mobile */
    .hds-ps-panel,
    .hds-ps-position-left .hds-ps-panel {
        width: 100%;
        height: 90vh;
        max-height: 90vh;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .hds-ps-panel.hds-ps-open,
    .hds-ps-position-left .hds-ps-panel.hds-ps-open {
        transform: translateY(0);
    }

    .hds-ps-panel-header {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .hds-ps-panel-content {
        padding: 20px 15px;
    }
    
    /* Notification modal slides up from bottom on mobile */
    .hds-ps-notify-modal {
        align-items: flex-end;
        justify-content: stretch;
    }
    
    .hds-ps-notify-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        animation: none;
    }
    
    .hds-ps-notify-modal.hds-ps-modal-open .hds-ps-notify-content {
        transform: translateY(0);
        animation: none;
    }

    .hds-ps-notify-header {
        padding: 25px 18px 18px;
    }
    
    .hds-ps-notify-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .hds-ps-notify-title {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .hds-ps-notify-message {
        font-size: 15px;
    }
    
    .hds-ps-notify-offer {
        margin: 15px 18px 0;
        padding: 10px 16px;
    }
    
    .hds-ps-notify-offer-text {
        font-size: 14px;
    }

    .hds-ps-notify-form {
        padding: 22px 18px;
    }
    
    .hds-ps-notify-form-group {
        margin-bottom: 15px;
    }
    
    .hds-ps-notify-form-group input[type="text"],
    .hds-ps-notify-form-group input[type="email"] {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .hds-ps-notify-submit {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* Move close button to top LEFT on mobile */
    .hds-ps-notify-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        line-height: 28px;
        top: 16px;
        left: 16px;
        right: auto;
    }
}
