/* Login Form */
.login-container {
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(130, 46, 245, 0.2);
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(130, 46, 245, 0.3);
    border-radius: 0.5rem;
    background-color: #242430;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(130, 46, 245, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-primary);
    width: 100%;
    box-shadow: 0 4px 12px rgba(130, 46, 245, 0.3);
}

.btn-primary:hover {
    background-color: #9145ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(130, 46, 245, 0.5);
}

.btn-logout {
    background: var(--danger-color);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    width: 100%;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-settings {
    background: var(--background-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--text-secondary);
}

.btn-settings:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

/* Tag Input */
.tag-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tag-input {
    width: 200px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--text-secondary);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.75rem;
}

.tag-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.btn-add-tags {
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.btn-add-tags:hover {
    background: var(--secondary-color);
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.api-key-message {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-key-message a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.api-key-message a:hover {
    text-decoration: underline;
}

/* Button Variants */
.btn-blue-label {
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.btn-blue-label:hover {
    background: var(--secondary-color);
}

.btn-blue-label:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Settings Section */
.settings-section {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-field label {
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-field input {
    padding: 0.75rem;
    border: 1px solid var(--text-secondary);
    border-radius: 0.5rem;
    font-family: inherit;
}

.settings-field input:disabled {
    background: var(--background-color);
    cursor: not-allowed;
}

.settings-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--text-secondary);
}

.api-key-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
}

/* Toggle Switch */
.toggle-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.toggle-group.compact {
    margin-bottom: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Settings Form */
.settings-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group.compact {
    margin-bottom: 0.75rem;
}

.form-group.compact label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.form-group.compact input {
    padding: 0.5rem 0.75rem;
}

.sync-info {
    background-color: rgba(130, 46, 245, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.sync-info i {
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.sync-info p {
    margin: 0;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin: 0.5rem 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Input with icon */
.input-with-icon {
    position: relative;
    display: flex;
    width: 100%;
}

.input-with-icon input {
    flex: 1;
    padding-right: 2.5rem;
}

.toggle-visibility {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-visibility:hover {
    color: var(--primary-color);
}

.input-readonly {
    background-color: #1a1a24 !important;
    color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Delete Account Form */
.delete-account-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delete-account-form .form-group {
    margin-bottom: 0;
}

.delete-account-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.delete-account-form .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.25rem;
    background-color: rgba(36, 36, 48, 0.8);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.delete-account-form .form-group input:focus {
    border-color: var(--danger-color);
    outline: none;
}

.delete-account-form .form-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* Loading spinner */
@keyframes spinner {
    to {transform: rotate(360deg);}
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner .6s linear infinite;
}