/* ===== andtoand.kr Design System =====
 * Based on: shadcn/ui tokens + Toss design principles
 * Font: Pretendard Variable
 * Icons: Lucide
 * Grid: 8px
 */

/* ===== Pretendard Font ===== */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
    /* ===== Colors (HSL) ===== */
    --primary: 168 83% 30%;
    --primary-foreground: 0 0% 100%;

    --background: 0 0% 100%;
    --foreground: 220 15% 12%;

    --card: 0 0% 100%;
    --card-foreground: 220 15% 12%;

    --secondary: 220 14% 96%;
    --secondary-foreground: 220 15% 30%;

    --muted: 220 14% 96%;
    --muted-foreground: 220 9% 46%;

    --accent: 220 14% 96%;
    --accent-foreground: 220 15% 12%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --success: 160 84% 39%;
    --warning: 38 92% 50%;

    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 168 83% 30%;

    /* ===== Spacing (8px grid) ===== */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* ===== Border Radius ===== */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* ===== Shadows ===== */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08);

    /* ===== Transitions ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base ===== */
body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont,
                 system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: hsl(var(--foreground));
    background: hsl(var(--background));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'tnum';
}

/* ===== Utility Classes ===== */

/* Text sizes */
.text-xs   { font-size: 0.75rem; line-height: 1rem; }
.text-sm   { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg   { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl   { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl  { font-size: 1.5rem; line-height: 2rem; }
.text-3xl  { font-size: 1.875rem; line-height: 2.25rem; }

/* Text colors */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-success { color: hsl(var(--success)); }

/* Result number display */
.text-result {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    color: hsl(var(--foreground));
}

/* ===== Component: Card ===== */
.ds-card {
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: box-shadow var(--transition-fast);
}

.ds-card:hover {
    box-shadow: var(--shadow-sm);
}

/* ===== Component: Button ===== */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    transition: opacity var(--transition-fast), background var(--transition-fast);
    border: none;
    text-decoration: none;
    line-height: 1.25rem;
}

.ds-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ds-btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.ds-btn-primary:hover {
    opacity: 0.9;
}

.ds-btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

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

.ds-btn-ghost {
    background: transparent;
    color: hsl(var(--foreground));
}

.ds-btn-ghost:hover {
    background: hsl(var(--accent));
}

.ds-btn-destructive {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.ds-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.ds-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.ds-btn-full {
    width: 100%;
}

/* ===== Component: Input ===== */
.ds-input {
    width: 100%;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.ds-input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.ds-input::placeholder {
    color: hsl(var(--muted-foreground));
}

/* ===== Component: Badge ===== */
.ds-badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
}

.ds-badge-default {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.ds-badge-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.ds-badge-outline {
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.ds-badge-destructive {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.ds-badge-success {
    background: hsl(var(--success) / 0.1);
    color: hsl(var(--success));
}

/* ===== Component: Separator ===== */
.ds-separator {
    height: 1px;
    background: hsl(var(--border));
    border: none;
    margin: var(--spacing-lg) 0;
}

/* ===== Layout Helpers ===== */
.ds-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.ds-container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.ds-section {
    padding: var(--spacing-2xl) 0;
}

/* ===== Lucide Icon Sizing ===== */
.icon {
    width: 1em;
    height: 1em;
    stroke-width: 2;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ds-card {
        padding: var(--spacing-md);
    }

    .ds-container,
    .ds-container-wide {
        padding: 0 var(--spacing-md);
    }

    .text-result {
        font-size: 1.75rem;
    }

    .ds-section {
        padding: var(--spacing-xl) 0;
    }
}
