﻿.form-container {
    background: var(--container-bg);
    border: 1px solid rgba(123, 182, 120, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    margin: 0 auto;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(123, 182, 120, 0.1);
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
}

/* Toggle Section */
.toggle-section {
    background: rgba(123, 182, 120, 0.05);
    border: 1px solid rgba(123, 182, 120, 0.15);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.toggle-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(123, 182, 120, 0.1), rgba(123, 182, 120, 0.05));
    border-radius: 0.75rem;
    z-index: -1;
}

.main-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Toggle Switch Component */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-status {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-radius: 2px;
}

/* Form Layout */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row.single,
.form-row.single-col {
    grid-template-columns: 1fr;
}

.form-row .form-col {
    display: flex;
    flex-direction: column;
}

.form-row .form-col.no-min-width {
    min-width: 0;
}

.form-row:has(.form-col:only-child) {
    grid-template-columns: 1fr;
}

/* Form Controls */
.form-control, .form-select {
    background: var(--bg-color);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    min-height: 56px;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(123, 182, 120, 0.15);
    transform: translateY(-1px);
}

.form-control:disabled, .form-control:read-only {
    background: rgba(123, 182, 120, 0.05);
    border-color: rgba(123, 182, 120, 0.1);
    color: var(--text-color);
    opacity: 0.6;
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating > label {
    position: absolute;
    top: 1rem;
    left: 0.5rem;
    padding: 0 0.5rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    opacity: 0.6;
    font-weight: 500;
    background: transparent;
    border-radius: 0.25rem;
    z-index: 2;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control[value]:not([value=""]) ~ label,
.form-floating > .form-control:-webkit-autofill ~ label,
.form-floating > label.active,
.form-floating > .form-control.has-value ~ label {
    opacity: 1;
    transform: scale(0.75) translateY(-1.75rem) translateX(-0.1rem);
    color: var(--accent-color);
    padding: 0.25rem 0.5rem;
    top: 1.25rem;
}

.form-floating > .form-control:not(:placeholder-shown),
.form-floating > .form-control[value]:not([value=""]),
.form-floating > .form-control.has-value {
    padding-top: 1.25rem;
    padding-bottom: 0.75rem;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(123, 182, 120, 0.05);
    border: 1px solid rgba(123, 182, 120, 0.15);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    user-select: none;
}

.custom-checkbox:hover {
    background: rgba(123, 182, 120, 0.1);
    border-color: rgba(123, 182, 120, 0.3);
}

.custom-checkbox:active {
    transform: scale(0.98);
}

.custom-checkbox input[type="checkbox"],
.custom-checkbox .form-check-input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-color);
    cursor: pointer;
    margin: 0;
    pointer-events: none;
}

.custom-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    pointer-events: none;
    flex: 1;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border: none;
    color: var(--bg-color);
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(123, 182, 120, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Form States */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(0.3);
}

.form-disabled .form-control,
.form-disabled .form-select {
    background: rgba(123, 182, 120, 0.05);
    border-color: rgba(123, 182, 120, 0.1);
}

.settings-section {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.settings-section.disabled {
    opacity: 0.3;
    transform: scale(0.98);
    pointer-events: none;
}

.readonly-field,
.readonly-field .select2-selection {
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
}

/* Form Icons */
.form-icon {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* Validation Styles */
.text-danger {
    color: #dc3545 !important;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

.input-validation-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.validation-summary-errors {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.5rem;
}

.form-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #28a745;
    text-align: center;
    font-weight: 500;
}

/* Animation Utilities */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .main-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dashboard-header {
        text-align: center;
        margin-bottom: 2rem;
    }
}