// DragonX Wallet - ImGui Edition
// Copyright 2024-2026 The Hush Developers
// Released under the GPLv3

// ============================================================================
// Material Design Typography Quick Reference
// ============================================================================
//
// Include this header for convenient access to the typography system.
//
// Usage:
//   #include "ui/material/type.h"
//   
//   // Access fonts directly
//   ImGui::PushFont(Type().h5());
//   ImGui::Text("Card Title");
//   ImGui::PopFont();
//   
//   // Use text helpers
//   Type().text(TypeStyle::H5, "Card Title");
//   Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), "Timestamp");
//   
//   // Scoped font (RAII)
//   MATERIAL_FONT(Body1) {
//       ImGui::TextWrapped("Body text goes here...");
//   }

#pragma once

#include "typography.h"
#include "colors.h"

namespace dragonx {
namespace ui {
namespace material {

// ============================================================================
// Convenience Accessor
// ============================================================================

/**
 * @brief Quick access to Typography singleton
 * 
 * Usage:
 *   ImFont* title = Type().h5();
 *   Type().text(TypeStyle::Body1, "Hello");
 */
inline Typography& Type() {
    return Typography::instance();
}

// ============================================================================
// Text Style Constants for Quick Reference
// ============================================================================

// Headers (Large display text)
// H1: 96px Light  - Rare, used for massive display numbers
// H2: 60px Light  - Section banners
// H3: 48px Regular - Major section titles
// H4: 34px Regular - Page titles
// H5: 24px Regular - Card titles, dialog titles
// H6: 20px Medium  - Section headers, sidebar items

// Body (Primary content)
// Subtitle1: 16px Regular - Secondary information, list item primary text
// Subtitle2: 14px Medium  - List item secondary text, menu items
// Body1:     16px Regular - Primary body text (default for content)
// Body2:     14px Regular - Secondary body text

// UI Elements
// Button:   14px Medium, UPPERCASE - Button labels
// Caption:  12px Regular - Timestamps, hints, helper text
// Overline: 10px Regular, UPPERCASE - Section labels, tabs

// ============================================================================
// Common Typography Patterns
// ============================================================================

/**
 * @brief Render a card header with title and optional subtitle
 */
inline void CardHeader(const char* title, const char* subtitle = nullptr)
{
    Type().text(TypeStyle::H5, title);
    if (subtitle) {
        Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), subtitle);
    }
}

/**
 * @brief Render an overline label (uppercase section marker)
 */
inline void OverlineLabel(const char* text)
{
    Type().textColored(TypeStyle::Overline, OnSurfaceMedium(), text);
}

/**
 * @brief Render body text
 */
inline void BodyText(const char* text, bool secondary = false)
{
    Type().text(secondary ? TypeStyle::Body2 : TypeStyle::Body1, text);
}

/**
 * @brief Render caption/helper text
 */
inline void Caption(const char* text)
{
    Type().textColored(TypeStyle::Caption, OnSurfaceMedium(), text);
}

/**
 * @brief Render error text
 */
inline void ErrorText(const char* text)
{
    Type().textColored(TypeStyle::Body2, Error(), text);
}

/**
 * @brief Render success text
 */
inline void SuccessText(const char* text)
{
    Type().textColored(TypeStyle::Body2, Success(), text);
}

/**
 * @brief Render a balance/amount display (large number)
 */
inline void AmountDisplay(const char* amount, const char* unit = nullptr)
{
    Type().text(TypeStyle::H4, amount);
    if (unit) {
        ImGui::SameLine();
        Type().textColored(TypeStyle::H6, OnSurfaceMedium(), unit);
    }
}

} // namespace material
} // namespace ui
} // namespace dragonx
