@extends('layouts.master')

@section('title', 'Tariffs')

@section('content')
<style>
:root{--sky:#0ea5e9;--sky-deep:#0369a1;--sky-ghost:rgba(14,165,233,.07);--sky-border:rgba(14,165,233,.2);--ink-mid:#3f4a5a;--white:#fff;--off:#f7fbff;--surface:#eef6fd;--border:#daeaf8;--danger:#ef4444;--danger-bg:rgba(239,68,68,.08);--danger-border:rgba(239,68,68,.2);--amber:#f59e0b;--amber-bg:rgba(245,158,11,.08);--amber-border:rgba(245,158,11,.22);--fd:'Cormorant Garamond',Georgia,serif;--fb:'DM Sans',system-ui,sans-serif;--fm:'DM Mono',monospace}
.main-content{background:var(--off);font-family:var(--fb)}
.main-content .container,.main-content .tx-page,.main-content .page-wrap,.main-content .content-wrapper,.main-content .wrap{background:var(--white);border:1px solid var(--border);border-radius:16px;box-shadow:0 8px 24px rgba(14,165,233,.1)}
.main-content h1,.main-content h2,.main-content h3{font-family:var(--fd);color:var(--sky-deep)}
.main-content .btn,.main-content .back-btn,.main-content .option-btn,.main-content .submit-btn,.main-content .refresh-btn,.main-content .action-btn,.main-content .act-btn,.main-content .link{border-radius:10px!important;font-family:var(--fb)!important;font-weight:600!important}
.main-content .btn-secondary,.main-content .back-btn,.main-content .refresh-btn,.main-content .btn-muted,.main-content .btn-ghost{background:#fff!important;color:var(--ink-mid)!important;border:1px solid var(--sky-border)!important}
.main-content .btn-primary,.main-content .option-btn,.main-content .submit-btn{background:linear-gradient(135deg,var(--sky-deep),var(--sky))!important;color:#fff!important;border:1px solid var(--sky-deep)!important}
.main-content table,.main-content .table{border-color:var(--border)!important}
.main-content thead,.main-content thead tr,.main-content th,.main-content .table thead th,.main-content .table-head-row{background:var(--surface)!important;color:var(--ink-mid)!important;border-color:var(--border)!important}
.main-content tbody tr:hover,.main-content .tx-row:hover{background:var(--sky-ghost)!important}
.main-content input,.main-content select,.main-content textarea{border:1px solid var(--border)!important;border-radius:10px!important;font-family:var(--fb)!important}
.main-content input:focus,.main-content select:focus,.main-content textarea:focus{border-color:var(--sky)!important;box-shadow:0 0 0 3px rgba(14,165,233,.12)!important}
.main-content .rate-badge,.main-content .badge,.main-content .status-badge{font-family:var(--fm)}
.main-content .actions,.main-content .cell-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.main-content a[href*='/edit'],.main-content .act-edit,.main-content .btn-warning{background:var(--amber-bg)!important;color:#92400e!important;border:1px solid var(--amber-border)!important}
.main-content .act-delete,.main-content form button[type='submit'].btn-danger,.main-content form button[onclick*='delete']{background:var(--danger-bg)!important;color:#991b1b!important;border:1px solid var(--danger-border)!important}
.main-content a[href*='/show'],.main-content .act-view{background:var(--sky-ghost)!important;color:var(--sky-deep)!important;border:1px solid var(--sky-border)!important}
</style>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">

<style>
/* ============================================================
   PROLEX — TARIFFS MENU — SKY BLUE · WHITE
   ============================================================ */

:root {
    --sky:         #0ea5e9;
    --sky-deep:    #0369a1;
    --sky-light:   #38bdf8;
    --sky-pale:    #e0f2fe;
    --sky-ghost:   rgba(14,165,233,0.08);
    --sky-border:  rgba(14,165,233,0.2);
    --sky-glow:    rgba(14,165,233,0.22);

    --ink:         #0c0f14;
    --ink-mid:     #3f4a5a;
    --ink-muted:   #7a8899;
    --ink-faint:   #b0bcc8;

    --white:       #ffffff;
    --off-white:   #f7fbff;
    --surface:     #eef6fd;
    --border:      #daeaf8;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;

    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--off-white);
    font-family: var(--font-body);
    color: var(--ink);
    min-height: 100vh;
}

/* ── page wrapper ── */
.tm-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

/* Ambient background circles */
.tm-page::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -15%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, rgba(14,165,233,0.07) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.tm-page::after {
    content: '';
    position: fixed;
    bottom: -15%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(56,189,248,0.06) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

/* ── card ── */
.tm-card {
    position: relative;
    z-index: 1;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow:
        0 0 0 1px rgba(14,165,233,0.05),
        0 8px 32px rgba(14,165,233,0.1),
        0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    animation: cardIn 0.6s var(--ease-smooth) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── card header banner ── */
.tm-banner {
    background: linear-gradient(135deg, var(--sky-deep) 0%, var(--sky) 60%, var(--sky-light) 100%);
    padding: 36px 36px 32px;
    position: relative;
    overflow: hidden;
}

/* Diagonal pattern overlay */
.tm-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,0.04) 0px,
        rgba(255,255,255,0.04) 1px,
        transparent 1px,
        transparent 12px
    );
}

/* Bottom arc */
.tm-banner::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--white);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.banner-back {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 6px 12px 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    transition: all 180ms;
    margin-bottom: 22px;
}

.banner-back:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateX(-3px);
}

.banner-icon {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.banner-title {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.01em;
    line-height: 1.1;
    margin-bottom: 6px;
}

.banner-sub {
    position: relative;
    z-index: 1;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

/* ── card body ── */
.tm-body {
    padding: 28px 32px 36px;
}

/* section label */
.body-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.body-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── option items ── */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--ink);
    overflow: hidden;
    cursor: pointer;
    transition: all 220ms var(--ease-smooth);
    animation: itemIn 0.5s var(--ease-smooth) both;
}

.option-item:nth-child(1) { animation-delay: 0.15s; }
.option-item:nth-child(2) { animation-delay: 0.25s; }

@keyframes itemIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Left accent bar */
.option-item::before {
    content: '';
    position: absolute;
    left: 0; top: 18%; bottom: 18%;
    width: 3px;
    background: var(--sky);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 200ms, top 200ms, bottom 200ms;
}

.option-item:hover {
    background: var(--white);
    border-color: var(--sky-border);
    box-shadow: 0 4px 20px var(--sky-glow), 0 2px 8px rgba(0,0,0,0.04);
    transform: translateX(4px);
}

.option-item:hover::before {
    opacity: 1;
    top: 10%;
    bottom: 10%;
}

/* Icon box */
.option-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--sky-ghost);
    border: 1px solid var(--sky-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: all 220ms var(--ease-smooth);
}

.option-item:hover .option-icon {
    background: var(--sky);
    border-color: var(--sky);
    box-shadow: 0 4px 14px var(--sky-glow);
    transform: scale(1.08);
}

/* Text */
.option-text { flex: 1; }

.option-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 3px;
    letter-spacing: 0.01em;
    transition: color 180ms;
}

.option-item:hover .option-title { color: var(--sky-deep); }

.option-desc {
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.4;
}

/* Arrow */
.option-arrow {
    font-size: 18px;
    color: var(--ink-faint);
    transition: all 200ms var(--ease-smooth);
    flex-shrink: 0;
}

.option-item:hover .option-arrow {
    color: var(--sky);
    transform: translateX(4px);
}

/* Ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleAnim 600ms linear;
    background: rgba(14,165,233,0.18);
    pointer-events: none;
}

@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* ── footer ── */
.tm-footer {
    margin-top: 24px;
    padding: 16px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.5;
}

.footer-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: var(--sky);
}

/* ── responsive ── */
@media (max-width: 520px) {
    .tm-banner { padding: 28px 24px 28px; }
    .tm-body   { padding: 22px 22px 30px; }
    .banner-title { font-size: 28px; }
}
</style>

<div class="tm-page" role="main">
    <div class="tm-card">

        {{-- Banner --}}
        <div class="tm-banner">
            <a href="{{ route('modules.edit.lawyers') }}" class="banner-back">
                ← Back to Lawyers
            </a>
            <div class="banner-icon">⚖</div>
            <div class="banner-title">Tariffs</div>
            <div class="banner-sub">Billing Schedule</div>
        </div>

        {{-- Body --}}
        <div class="tm-body">
            <div class="body-label">Choose an action</div>

            <div class="option-list" role="list">

                <a href="{{ route('tariffs.create') }}" class="option-item" role="listitem" tabindex="0">
                    <div class="option-icon">＋</div>
                    <div class="option-text">
                        <div class="option-title">Add Tariff</div>
                        <div class="option-desc">Create a new billing tariff entry</div>
                    </div>
                    <div class="option-arrow">→</div>
                </a>

                <a href="{{ url('/modules/tariffs') }}" class="option-item" role="listitem" tabindex="0">
                    <div class="option-icon">☰</div>
                    <div class="option-text">
                        <div class="option-title">View Tariffs</div>
                        <div class="option-desc">Browse and manage all existing tariffs</div>
                    </div>
                    <div class="option-arrow">→</div>
                </a>

            </div>

            <div class="tm-footer">
                <span class="footer-icon">ℹ</span>
                <span>Tariffs define billing rates per lawyer tier and service type. Changes apply to new invoices only.</span>
            </div>
        </div>

    </div>
</div>

<script>
document.querySelectorAll('.option-item').forEach(item => {
    item.addEventListener('click', function (e) {
        const ripple = document.createElement('span');
        ripple.classList.add('ripple');
        this.appendChild(ripple);

        const rect = this.getBoundingClientRect();
        const size = Math.max(rect.width, rect.height);
        ripple.style.cssText = `
            width: ${size}px; height: ${size}px;
            left: ${e.clientX - rect.left - size / 2}px;
            top:  ${e.clientY - rect.top  - size / 2}px;
        `;
        ripple.addEventListener('animationend', () => ripple.remove());
    });
});
</script>

@endsection


