<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Service List</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background: #f5f5f5;
        }

        @media print {
            body {
                background: white;
            }

            .no-print {
                display: none !important;
            }
        }

        .report-container {
            max-width: 11in;
            margin: 20px auto;
            padding: 40px;
            background: white;
            box-shadow: 0 0 10px rgba(206, 89, 89, 0.1);
        }

        .report-header {
            border-bottom: 3px solid #2c3e50;
            margin-bottom: 20px;
            padding-bottom: 15px;
            text-align: center;
        }

        .company-logo {
            font-size: 24px;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .company-info {
            font-size: 11px;
            color: #666;
            line-height: 1.4;
        }

        .report-title {
            font-size: 18px;
            font-weight: bold;
            color: #e6906e;
            margin-top: 15px;
            margin-bottom: 10px;
        }

        .report-period {
            font-size: 12px;
            color: #666;
            margin-bottom: 30px;
        }

        .service-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
            font-size: 14px;
        }

        .service-table th,
        .service-table td {
            border: 1px solid #ddd;
            padding: 8px;
        }

        .service-table th {
            background: #e45f47;
            color: white;
            text-align: left;
        }

        .print-button {
            display: inline-block;
            margin: 20px auto;
            padding: 10px 20px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

        .print-button:hover {
            background: #2980b9;
        }

        .no-print-container {
            text-align: center;
            margin: 20px 0;
        }
    </style>
</head>
<body>

    <div class="report-container">
        <div class="report-header">
             <div style="text-align: center; margin-bottom: 30px;">
                <h1 style="margin: 0; font-size: 32px; font-weight: bold;">STARUP MIND</h1>
                <p style="margin: 5px 0 0; font-size: 16px;">Your Trusted Technology Partner</p>
            </div>
            <div class="report-title">Service List</div>
            <div class="report-period">Generated on {{ now()->format('d M Y') }}</div>
        </div>

        <table class="service-table">
            <thead>
                <tr>
                    <th>Service Code</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Cost Per Service</th>
                    <th>Service Price</th>
                </tr>
            </thead>
            <tbody>
                @foreach($services as $service)
                    <tr>
                        <td>{{ $service->service_code }}</td>
                        <td>{{ $service->name }}</td>
                        <td>{{ $service->description ?? '-' }}</td>
                        <td>{{ number_format($service->cost_price, 2) }}</td>
                        <td>{{ number_format($service->price, 2) }}</td>
                    </tr>
                @endforeach
            </tbody>
        </table>

        <div class="no-print-container no-print">
            <button class="print-button" onclick="window.print()">Print</button>
        </div>
    </div>

    <script>
        // Auto-print when requested
        if (new URLSearchParams(window.location.search).get('autoprint') === '1') {
            setTimeout(() => {
                window.print();
            }, 500);
        }
    </script>
</body>
</html>
