@use "sass:color";

$primary-color: #6200ee; // Standard Material primary or project primary
$bg-color: transparent;
$card-bg: #ffffff;
$border-color: #e0e0e0;
$text-primary: #333333;
$text-secondary: #666666;

.FormOverView {
    padding: 24px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;

    .page-title {
        font-size: 24px;
        font-weight: 600;
        color: #1a1a1a;
        margin: 0 0 4px 0;
    }

    .page-subtitle {
        font-size: 14px;
        color: #666;
        margin: 0;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 16px;

        .view-toggles {
            display: flex;
            background: #eee;
            padding: 4px;
            border-radius: 8px;

            .toggle-btn {
                width: 32px;
                height: 32px;
                line-height: 32px;
                border-radius: 6px;
                color: #666;

                &.active {
                    background: #2563eb;
                    color: white;
                }

                mat-icon {
                    font-size: 18px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }
            }
        }

        .create-btn {
            background-color: #2563eb;
            color: white;
            border-radius: 8px;
            height: 40px;
            padding: 0 20px;
        }
    }
}

.main-layout {
    display: flex;
    gap: 24px;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    height: fit-content;

    .sidebar-title {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 16px;
    }

    .filter-group {
        margin-bottom: 24px;

        .group-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 500;
            color: #374151;
            margin-bottom: 12px;
            cursor: pointer;

            mat-icon {
                font-size: 18px;
                width: 18px;
                height: 18px;
                color: #9ca3af;
            }
        }

        .group-content {
            padding-left: 26px;

            .filter-item {
                display: flex;
                align-items: center;
                gap: 8px;
                margin-bottom: 8px;

                input[type="checkbox"] {
                    width: 16px;
                    height: 16px;
                    border-radius: 4px;
                    border: 1px solid #d1d5db;
                }

                label {
                    font-size: 13px;
                    color: #4b5563;
                    background: #e0f2fe; // Light blue/gray accent
                    padding: 2px 10px;
                    border-radius: 6px;
                    border: 1px solid #bae6fd;
                }
            }
        }
    }

    .dropdown-filters {
        display: flex;
        flex-direction: column;
        gap: 16px;

        .filter-field {
            display: flex;
            flex-direction: column;
            gap: 4px;

            label {
                font-size: 12px;
                font-weight: 500;
                color: #6b7280;
            }

            select {
                padding: 8px 12px;
                border: 1px solid #d1d5db;
                border-radius: 8px;
                font-size: 13px;
                color: #374151;
                outline: none;
            }
        }
    }
}

.content-area {
    flex: 1;

    .search-container {
        position: relative;
        margin-bottom: 24px;

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
        }

        input {
            width: 100%;
            padding: 12px 12px 12px 40px;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            font-size: 14px;
            background: white;
            outline: none;

            &:focus {
                border-color: #2563eb;
            }
        }
    }
}

.models-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.model-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.2s;

    &:hover {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    .card-top {
        display: flex;
        gap: 16px;
        margin-bottom: 20px;

        .model-icon {
            width: 48px;
            height: 48px;
            background: #eff6ff;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #2563eb;
        }

        .model-main-info {
            flex: 1;

            .title-row {
                display: flex;
                align-items: center;
                gap: 12px;
                margin-bottom: 4px;

                .model-name {
                    font-size: 18px;
                    font-weight: 600;
                    color: #111827;
                    margin: 0;
                }

                .version-tag {
                    font-size: 11px;
                    background: #f3f4f6;
                    padding: 2px 6px;
                    border-radius: 4px;
                    color: #6b7280;
                }

                .status-badge {
                    font-size: 11px;
                    padding: 2px 8px;
                    border-radius: 100px;
                    font-weight: 500;

                    &.active {
                        background: #dcfce7;
                        color: #166534;
                    }
                }

                .type-tag {
                    font-size: 11px;
                    color: #3b82f6;
                    border: 1px solid #bfdbfe;
                    padding: 2px 8px;
                    border-radius: 100px;
                }
            }

            .meta-info {
                display: flex;
                align-items: center;
                gap: 8px;
                font-size: 12px;
                color: #6b7280;

                .model-id {
                    font-family: monospace;
                    background: #f9fafb;
                    padding: 1px 4px;
                }
            }
        }

        .card-actions {
            display: flex;
            gap: 4px;
            color: #9ca3af;
        }
    }

    .card-stats {
        display: flex;
        gap: 32px;
        margin-bottom: 24px;
        padding-left: 64px;

        .stat-item {
            display: flex;
            flex-direction: column;

            .stat-value {
                font-size: 18px;
                font-weight: 600;
                color: #111827;
            }

            .stat-label {
                font-size: 12px;
                color: #6b7280;
            }
        }
    }

    .sample-fields {
        padding-top: 16px;
        border-top: 1px solid #f3f4f6;
        padding-left: 64px;

        .section-title {
            font-size: 12px;
            font-weight: 600;
            color: #6b7280;
            margin-bottom: 12px;
        }

        .fields-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;

            .field-tag {
                font-size: 12px;
                font-family: monospace;
                background: #f3f4f6;
                padding: 4px 8px;
                border-radius: 4px;
                color: #374151;
            }

            .more-tag {
                font-size: 12px;
                color: #9ca3af;
                align-self: center;
            }
        }
    }
}

.create-container {
    max-width: 1000px;
    margin: 0 auto;

    .back-link {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #4b5563;
        font-size: 14px;
        cursor: pointer;
        margin-bottom: 32px;
        width: fit-content;

        &:hover {
            color: #2563eb;
        }

        mat-icon {
            font-size: 18px;
            width: 18px;
            height: 18px;
        }
    }

    .create-header {
        margin-bottom: 48px;

        .page-title {
            font-size: 28px;
            font-weight: 600;
            color: #111827;
            margin: 0 0 8px 0;
        }

        .page-subtitle {
            font-size: 15px;
            color: #6b7280;
            margin: 0;
        }
    }

    .method-section {
        .section-title {
            font-size: 18px;
            font-weight: 600;
            color: #111827;
            margin-bottom: 24px;
        }

        .method-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 24px;
        }

        .method-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 16px;
            padding: 32px;
            cursor: pointer;
            transition: all 0.2s;

            &:hover {
                border-color: #2563eb;
                box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
                transform: translateY(-2px);
            }

            .method-icon {
                width: 48px;
                height: 48px;
                border-radius: 12px;
                display: flex;
                align-items: center;
                justify-content: center;
                margin-bottom: 24px;

                &.blue {
                    background: #eff6ff;
                    color: #2563eb;
                }

                &.purple {
                    background: #f5f3ff;
                    color: #7c3aed;
                }

                &.green {
                    background: #f0fdf4;
                    color: #16a34a;
                }

                mat-icon {
                    font-size: 24px;
                    width: 24px;
                    height: 24px;
                }
            }

            .method-name {
                font-size: 18px;
                font-weight: 600;
                color: #111827;
                margin: 0 0 12px 0;
            }

            .method-desc {
                font-size: 14px;
                color: #6b7280;
                line-height: 1.5;
                margin: 0;
            }
        }
    }

    &.manual-form {
        max-width: 900px;
        margin: 0 auto;

        .form-card-container {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 16px;
            padding: 32px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

            .card-header-row {
                margin-bottom: 24px;
            }

            .card-section-title {
                font-size: 18px;
                font-weight: 600;
                color: #111827;
                margin: 0;
            }
        }

        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 32px;

            .form-group {
                display: flex;
                flex-direction: column;
                gap: 8px;

                &.full-width {
                    grid-column: 1 / -1;
                }

                label {
                    font-size: 13px;
                    font-weight: 500;
                    color: #374151;
                }

                .form-input,
                .form-select,
                .form-textarea {
                    padding: 10px 14px;
                    border: 1px solid #d1d5db;
                    border-radius: 8px;
                    font-size: 14px;
                    color: #1f2937;
                    outline: none;
                    transition: all 0.2s;
                    background: white;

                    &:focus {
                        border-color: #2563eb;
                        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
                    }

                    &::placeholder {
                        color: #9ca3af;
                    }
                }

                .form-textarea {
                    resize: vertical;
                    min-height: 100px;
                }
            }
        }

        .fields-section {
            border-top: 1px solid #f3f4f6;
            padding-top: 32px;
            margin-top: 32px;
            margin-bottom: 48px;

            .fields-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 24px;

                .fields-title {
                    font-size: 15px;
                    font-weight: 600;
                    color: #111827;
                    margin: 0;
                }

                .fields-actions {
                    display: flex;
                    gap: 12px;

                    button {
                        padding: 8px 16px;
                        border-radius: 8px;
                        font-size: 13px;
                        font-weight: 500;
                        cursor: pointer;
                        transition: all 0.2s;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                    }

                    .action-btn-outline {
                        background: white;
                        border: 1px solid #e5e7eb;
                        color: #374151;

                        &:hover {
                            background: #f9fafb;
                            border-color: #d1d5db;
                        }
                    }

                    .action-btn-black {
                        background: #111827;
                        border: 1px solid #111827;
                        color: white;

                        &:hover {
                            background: #1f2937;
                        }
                    }
                }
            }

            .json-paste-box {
                background: #f9fafb;
                border: 1px solid #e5e7eb;
                border-radius: 8px;
                padding: 12px 16px;
                display: flex;
                align-items: center;
                gap: 8px;

                mat-icon {
                    font-size: 14px;
                    width: 14px;
                    height: 14px;
                    color: #2563eb;
                }

                .blue-link {
                    font-size: 13px;
                    color: #2563eb;
                    font-weight: 500;
                    cursor: pointer;

                    &:hover {
                        text-decoration: underline;
                    }
                }
            }
        }

        .form-footer {
            display: flex;
            gap: 12px;
            padding-top: 24px;
            border-top: 1px solid #f3f4f6;

            button {
                height: 44px;
                border-radius: 8px;
                font-size: 14px;
                font-weight: 600;
                cursor: pointer;
                padding: 0 24px;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
                transition: all 0.2s;
            }

            .save-btn-black {
                flex: 1;
                background: #111827;
                color: white;
                border: none;

                &:hover {
                    background: #1f2937;
                }

                mat-icon {
                    font-size: 18px;
                    width: 18px;
                    height: 18px;
                }
            }

            .cancel-btn-outline {
                background: white;
                border: 1px solid #e5e7eb;
                color: #374151;

                &:hover {
                    background: #f9fafb;
                }
            }
        }
    }
}