/**
 * Links Editor Modal Styles
 * Matches settings-modal and contact-modal design patterns
 */

/* Modal Overlay */
.links-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.links-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.links-modal.hide {
    display: flex;
    animation: fadeOut 0.3s ease-out;
}

/* Modal Content */
.links-modal-content {
    background: var(--cream);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.links-modal.show .links-modal-content {
    animation: slideIn 0.3s ease-out;
}

.links-modal.hide .links-modal-content {
    animation: slideOut 0.3s ease-out;
}

/* Modal Header */
.links-modal-header {
    padding: 20px;
    background: var(--dark-gray);
    color: var(--cream);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.links-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.links-modal-header h3 .material-symbols-outlined {
    font-size: 24px;
}

.links-modal-header .modal-close {
    background: transparent;
    border: none;
    color: var(--cream);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

.links-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.links-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Form Sections */
.links-section {
    margin-bottom: 20px;
}

.links-section:last-child {
    margin-bottom: 0;
}

.links-section > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

/* Form Inputs */
.links-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tan);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--white, #fff);
    color: var(--dark-gray);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.links-input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(235, 94, 40, 0.1);
}

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

/* Additional Links Container */
.links-additional-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.links-additional-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.links-additional-row .links-name-input {
    width: 35%;
    flex-shrink: 0;
}

.links-additional-row .links-url-input {
    flex: 1;
}

.links-remove-btn {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #999;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.links-remove-btn:hover {
    background: #fee;
    color: #e74c3c;
}

.links-remove-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Add Link Button */
.btn-add-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px dashed var(--tan);
    background: transparent;
    color: var(--dark-gray);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-link:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(235, 94, 40, 0.05);
}

.btn-add-link .material-symbols-outlined {
    font-size: 18px;
}

/* Modal Footer */
.links-modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--tan);
    background: var(--cream);
    border-radius: 0 0 12px 12px;
}

/* Modal Buttons - Match confirm dialog styling */
.links-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.links-modal-btn .material-symbols-outlined {
    font-size: 22px;
}

/* Primary button - dark gray like other modals */
.links-modal-btn-primary {
    background: var(--dark-gray);
    border: 1px solid var(--dark-gray);
    color: var(--cream);
    box-shadow: 0 2px 8px rgba(37, 36, 34, 0.3);
}

.links-modal-btn-primary:hover {
    background: var(--almost-black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 36, 34, 0.4);
}

.links-modal-btn-primary:active {
    transform: translateY(0);
}

/* Secondary button - gray like cancel buttons */
.links-modal-btn-secondary {
    background: #e0e0e0;
    border: 1px solid #ccc;
    color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.links-modal-btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.links-modal-btn-secondary:active {
    transform: translateY(0);
}

/* Properties Panel Link Button */
.property-section-with-btn {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.property-section-with-btn {
    align-items: center;
}

.property-section-with-btn > div:first-child {
    flex: 1;
}

.btn-edit-links {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--tan);
    background: var(--white, #fff);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #888;
}

.btn-edit-links:hover {
    border-color: var(--dark-gray);
    color: var(--dark-gray);
    background: rgba(0, 0, 0, 0.05);
}

.btn-edit-links .material-symbols-outlined {
    font-size: 18px;
}

/* Links Dropdown for canvas (when clicking + icon) */
.links-dropdown {
    position: fixed;
    background: var(--cream);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-width: 300px;
    z-index: 10001;
    overflow: hidden;
    border: 1px solid var(--tan);
}

.links-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.15s;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.links-dropdown-item:last-child {
    border-bottom: none;
}

.links-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.links-dropdown-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--dark-gray);
    opacity: 0.6;
}

.links-dropdown-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar styling for modal body */
.links-modal-body::-webkit-scrollbar {
    width: 8px;
}

.links-modal-body::-webkit-scrollbar-track {
    background: var(--cream);
}

.links-modal-body::-webkit-scrollbar-thumb {
    background: var(--tan);
    border-radius: 4px;
}

.links-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}
