/* Target Components Styles - Modern Minimalist Design */

/* Color Variables */
:root {
    --main-color: #3b82f6;
    --main-color-hover: #2563eb;
    --main-color-active: #1d4ed8;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-placeholder: #9ca3af;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --background-white: #ffffff;
    --background-gray: #f9fafb;
    --background-button: #f3f4f6;
    --background-button-hover: #e5e7eb;
    --background-button-active: #d1d5db;
}
.target-item-card {
    background: transparent;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}

.target-item-card:hover {
    border-color: var(--border-medium);
}

.target-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: var(--background-white);
    padding: 16px;
}

.target-item-text {
    flex: 1;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    word-break: break-word;
}

.target-remove-button {
    background: var(--background-button);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-width: 80px;
}

.target-remove-button:hover {
    background: var(--background-button-hover);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.target-remove-button:active {
    background: var(--background-button-active);
}

/* Target Card Styles */
.target-card {
    background: transparent;
    padding: 32px;
    margin-bottom: 32px;
}

.target-card-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.target-card-description {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.target-empty-state {
    background: var(--background-gray);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-top: 20px;
}

.target-empty-text {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}

/* Select Input Styles */
.target-select-input {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.target-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 15px;
    background: var(--background-white);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    height: 48px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.target-select:focus {
    outline: none;
    border-color: var(--main-color);
}

.target-select:hover {
    border-color: var(--text-placeholder);
}

.target-text-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 15px;
    background: var(--background-white);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    height: 48px;
}

.target-text-input:focus {
    outline: none;
    border-color: var(--main-color);
}

.target-text-input:hover {
    border-color: var(--text-placeholder);
}

.target-text-input::placeholder {
    color: var(--text-placeholder);
}

.target-select-box {
    min-width: 180px;
}

.target-select-box.wide {
    min-width: 280px;
}

.target-select-box.extra-wide {
    min-width: 400px;
}

.target-add-button {
    background: var(--main-color);
    border: 1px solid var(--main-color);
    color: var(--background-white);
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: 48px;
}

.target-add-button:hover {
    background: var(--main-color-hover);
    border-color: var(--main-color-hover);
}

.target-add-button:active {
    background: var(--main-color-active);
}

/* Page Input Styles */
.target-page-input {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
}

.target-text-field {
    flex: 1;
    min-width: 400px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .target-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .target-item-text {
        width: 100%;
    }
    
    .target-remove-button {
        align-self: flex-end;
    }
    
    .target-select-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .target-select-box,
    .target-text-field {
        min-width: auto;
        width: 100%;
    }
    
    .target-add-button {
        width: 100%;
        justify-content: center;
    }
    
    .target-card {
        padding: 24px;
    }
    
    .popuptarget-overlay {
        padding: 10px;
    }
    
    .popuptarget-content {
        max-width: 100%;
        max-height: 95vh;
    }
}

/* Animation for adding items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.target-item-card.new-item {
    animation: slideIn 0.2s ease-out;
}

/* Focus states */
.target-remove-button:focus,
.target-add-button:focus {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* popuptarget Styles */
.popuptarget-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    height: auto;
    box-sizing: border-box;
}

.popuptarget-content {
    background: var(--background-white);
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: popuptargetSlideIn 0.2s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.popuptarget-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 0 20px;
}

.popuptarget-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.popuptarget-title {
    flex: 1;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.popuptarget-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.popuptarget-close:hover {
    background: var(--background-button);
    color: var(--text-secondary);
}

.popuptarget-body {
    padding: 16px 20px;
    flex: 1;
    overflow-y: auto;
}

.popuptarget-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.popuptarget-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: flex-end;
}

.popuptarget-button {
    background: var(--main-color);
    border: 1px solid var(--main-color);
    color: var(--background-white);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
}

.popuptarget-button:hover {
    background: var(--main-color-hover);
    border-color: var(--main-color-hover);
}

.popuptarget-button:active {
    background: var(--main-color-active);
}

@keyframes popuptargetSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Validation and error styles */
.target-text-input.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

.validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    animation: slideDown 0.2s ease;
}

.validation-loading {
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

.warning-message {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.target-add-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #6c757d !important;
}

.target-add-button:disabled:hover {
    background-color: #6c757d !important;
    transform: none !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}