@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-container {
    display: flex;
    width: 100%;
    height: 100%;
}



.right-panel {
    width: 70%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.left-panel {
    width: 30%;
    min-width: 350px;
    padding: 35px;
    background: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar track */
.left-panel::-webkit-scrollbar, .right-panel::-webkit-scrollbar {
    width: 5px;  /* width of vertical scrollbar */
    height: 5px; /* height of horizontal scrollbar */
}

/* Scrollbar thumb (the draggable part) */
.left-panel::-webkit-scrollbar-thumb, .right-panel::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.3); /* color of thumb */
    border-radius: 10px; /* round edges */
}

/* Optional: scrollbar track */
.left-panel::-webkit-scrollbar-track, .right-panel::-webkit-scrollbar-track {
    background: transparent; /* or some color */
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#url-input {
    width: 100%;
    padding: 16px 12px 12px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    padding-right: 45px;
}

#load-btn {
    padding: 5px;
    border: none;
    background-color: transparent;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

#load-btn svg {
    fill:#999;
    transition: 0.15s;
}

#load-btn svg:hover {
    fill:#007bff;
}

#selectors-manager {
    flex-grow: 1;
}

#fields-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}


.field-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field-row.active {
    /* Visual feedback for active state can be added here if needed */
}

.field-row label {
    font-weight: normal;
    color: #333;
    font-size: 14px;
}

/* Floating label field */
.floating-field {
    position: relative;
}

.floating-field input {
    width: 100%;
}

.floating-field .search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #007bff;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.floating-field .search-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.floating-field label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    padding: 0 4px;
    color: #6c757d;
    pointer-events: none;
    transition: 0.15s ease-in-out;
}

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%) scale(0.92);
    color: #007bff;
}

.floating-field input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 10px 8px 8px 8px; /* space for centered label */
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    cursor: text;
    position: relative;
}

.tags-input-container:focus-within {
    border-color: #007bff;
    /*box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);*/
}

/* Floating label inside multi-tag container */
.tags-input-container > label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 4px;
    background: #fff;
    color: #6c757d;
    font-size: 14px;
    line-height: 1;
    transform-origin: left top;
    transition: 0.10s ease-in-out;
    z-index: 1;
}

.tags-input-container:focus-within > label,
.tags-input-container:not(:has(.tags-input[placeholder=' ']:placeholder-shown)) > label,
.tags-input-container:has(.tag-item) > label {
    top: 0; /* sit on the border like URL field */
    transform: translateY(-50%) scale(0.92);
    font-size: 12px;
    color: #007bff;
    font-weight: bold;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: #eee;
    color: #333;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.tag-item .tag-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-item .tag-delete {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tag-item .tag-delete:hover {
    opacity: 1;
}

.tags-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    padding: 4px;
    font-size: 14px;
    background: transparent;
    z-index:10;
}

.tags-input::placeholder {
    color: #999;
}

.field-actions {
    display: flex;
    gap: 8px;
}

.select-btn {
    padding: 6px 12px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: transparent;
    color: #007bff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 120px;
}

#archive-btn{
    text-align: center;
    text-decoration: none;
}

.select-btn:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}


.actions-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.actions-section button {
    padding: 10px 15px;
}

.actions {
    padding: 20px 0px;
    gap: 20px;
    display: flex;
    border-top: solid 1px #ccc;
    margin-top: 20px;
;
}
#save-btn {
    background-color: #007bff;
    color: white;
    border: #007bff;
}
#save-btn:hover {
    background-color: #0056b3;
}

.iframe-container {
    flex-grow: 1;
    height: 100%;
    border: 1px solid #ccc;
}

#website-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    gap: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

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

#loading-message {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}
