/* Tab Segments */
.ps-profile__segment {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Custom Tab Segments */
.ps-profile__segment--Weather,
.ps-profile__segment--MakeBooking,
.ps-profile__segment--GetDirections,
.ps-profile__segment--New {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* iframe Container */
.iframe-container {
    position: relative;
    width: 100%;
    height: 1000px;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    margin-bottom: 20px;
}

/* iframe Styling */
.custom-tab-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
    z-index: 1;
}

/* Shortcode Content */
.shortcode-content {
    display: block !important;
    width: 100% !important;
    min-height: 400px !important;
    padding: 20px;
    background: #fff;
}

/* Admin Icon Selector */
.custom-tab-icon-select {
    min-width: 200px;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Tab Icons */
.ps-profile__menu-item i[class^="gcis"] {
    margin-right: 5px;
    font-size: 16px;
    vertical-align: middle;
}

/* Profile Menu Items */
.ps-profile__menu-item {
    position: relative;
    display: inline-block;
    margin: 0 10px;
    padding: 10px 15px;
    cursor: pointer;
}

/* Active Tab State */
.ps-profile__menu-item.active {
    border-bottom: 2px solid #007bff;
    color: #007bff;
}

/* Form Styling in Admin */
.form-table td p {
    margin: 10px 0;
}

.form-table input[type="text"],
.form-table select {
    width: 100%;
    max-width: 400px;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .ps-profile__segment {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .ps-profile__segment--Weather,
    .ps-profile__segment--MakeBooking,
    .ps-profile__segment--GetDirections,
    .ps-profile__segment--New {
        margin: 0 -20px !important;
        width: calc(100% + 40px) !important;
    }
    
    .iframe-container {
        padding-bottom: 75%; /* 4:3 Aspect Ratio for mobile */
        margin: 0;
        width: 100%;
    }
    
    .shortcode-content {
        padding: 10px 0;
        margin: 0 -20px;
        width: calc(100% + 40px) !important;
    }
    
    .custom-tab-iframe {
        width: 100% !important;
    }
    
    .ps-profile__menu-item {
        margin: 0 5px;
        padding: 8px 10px;
    }

    /* Target parent containers if needed */
    .ps-profile .ps-profile__content {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Error States */
.ps-profile__segment--error {
    padding: 20px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Loading States */
.ps-profile__segment--loading {
    position: relative;
    min-height: 200px;
}

.ps-profile__segment--loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
