/* Shared Components Styles - Used by both admin and public pages */

/* Form inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-input,
.form-textarea,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
}

.form-input:focus,
.form-textarea:focus,
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="date"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Autocomplete dropdown */
.autocomplete {
    position: relative;
}

.autocomplete input {
    padding-right: 35px; /* Make room for clear button */
}

.autocomplete-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 12px;
    pointer-events: none;
    user-select: none;
}

.autocomplete-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.autocomplete-clear:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.autocomplete-with-add {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-option {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.autocomplete-option:hover,
.autocomplete-option.selected {
    background: var(--hover-bg);
}

.autocomplete-option.highlighted {
    background: var(--accent-primary);
    color: white;
}

.autocomplete-option small {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.85em;
    margin-top: 2px;
}

.autocomplete-option.highlighted small {
    color: rgba(255, 255, 255, 0.8);
}

.autocomplete-no-results {
    padding: 15px;
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Standard buttons */
.btn-primary,
.btn-secondary,
.btn-info,
.btn-danger,
.btn-success {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}
.logo-card .btn-secondary {
    border-width: 0;
    box-shadow: 0px 0px 1px #000;
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--text-primary);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Button sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* Responsive design */
@media (max-width: 768px) {
    .autocomplete-with-add {
        flex-direction: column;
    }
}

/* Tag Input Component */
.tag-input-wrapper {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    padding: 8px;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    transition: border-color 0.3s ease;
}

.tag-input-wrapper:focus-within {
    border-color: var(--accent-primary);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: 16px;
    font-size: 0.9em;
    font-weight: 500;
}

.tag-name {
    user-select: none;
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tag-input {
    flex: 1;
    min-width: 150px;
    border: none;
    background: transparent;
    padding: 4px 8px;
    font-size: 1em;
    color: var(--text-primary);
    outline: none;
}

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

.tag-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 2px solid var(--accent-primary);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 2px;
}

.tag-suggestions-dropdown.active {
    display: block;
}

.tag-suggestion-option {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.tag-suggestion-option:hover,
.tag-suggestion-option.highlighted {
    background: var(--accent-primary);
    color: white;
}

/* Print styles */
@media print {
    .autocomplete-dropdown,
    .tag-suggestions-dropdown {
        display: none;
    }
}
