File size: 15,875 Bytes
1513f75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
608ef78
 
 
1513f75
 
608ef78
1513f75
608ef78
 
 
1513f75
 
 
608ef78
 
 
 
1513f75
608ef78
 
 
 
1513f75
608ef78
 
 
1513f75
608ef78
 
 
1513f75
608ef78
 
 
1513f75
95b951f
1513f75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<!DOCTYPE html>
<html lang="en" class="light">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Book Ticket | RailRush Express</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script>
        tailwind.config = {
            darkMode: 'class',
            theme: {
                extend: {
                    colors: {
                        primary: {
                            light: '#3949AB',
                            dark: '#5C6BC0'
                        },
                        accent: '#FFCA28',
                        background: {
                            light: '#F9FAFB',
                            dark: '#1E1E1E'
                        }
                    }
                }
            }
        }
    </script>
    <style>
        .material-card {
            border-radius: 12px;
            box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
        }
        
        .seat {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .seat:hover {
            transform: scale(1.1);
        }
        
        .seat-available {
            background-color: #4CAF50;
        }
        
        .seat-selected {
            background-color: #FFCA28;
        }
        
        .seat-booked {
            background-color: #757575;
        }
        
        .sticky-bottom-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 16px;
            background: white;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 100;
        }
        
        @media (min-width: 768px) {
            .sticky-bottom-bar {
                left: 80px;
            }
        }
    </style>
</head>
<body class="bg-background-light dark:bg-background-dark min-h-screen pb-24">
    <!-- Top App Bar -->
    <header class="bg-primary-light dark:bg-primary-dark text-white p-4 shadow-md">
        <div class="flex justify-between items-center max-w-6xl mx-auto">
            <div class="flex items-center space-x-2">
                <a href="index.html">
                    <i data-feather="arrow-left" class="w-5 h-5"></i>
                </a>
                <h1 class="text-xl font-bold">Seat Selection</h1>
            </div>
            <div class="flex items-center space-x-4">
                <div class="flex items-center space-x-1">
                    <div class="w-3 h-3 rounded-full bg-green-500"></div>
                    <span class="text-xs">Available</span>
                </div>
                <div class="flex items-center space-x-1">
                    <div class="w-3 h-3 rounded-full bg-yellow-400"></div>
                    <span class="text-xs">Selected</span>
                </div>
                <div class="flex items-center space-x-1">
                    <div class="w-3 h-3 rounded-full bg-gray-500"></div>
                    <span class="text-xs">Booked</span>
                </div>
            </div>
        </div>
    </header>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-4 py-6">
        <!-- Train Info Card -->
        <div class="material-card bg-white dark:bg-gray-800 p-4 mb-6">
            <div class="flex justify-between items-center mb-3">
                <div>
                    <h2 class="font-bold dark:text-white">Rajdhani Express (12952)</h2>
                    <p class="text-sm text-gray-500 dark:text-gray-400">Delhi → Mumbai</p>
                </div>
                <div class="text-sm">
                    <p class="dark:text-white">Tue, 15 Aug</p>
                    <p class="text-gray-500 dark:text-gray-400">16:25 - 09:00</p>
                </div>
            </div>
            <div class="flex justify-between items-center border-t border-gray-200 dark:border-gray-700 pt-3">
                <div class="flex items-center space-x-2">
                    <span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">3A</span>
                    <span class="chip bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">General</span>
                </div>
                <p class="text-primary-light dark:text-accent font-medium">₹1,850</p>
            </div>
        </div>

        <!-- Coach Selection -->
        <div class="mb-6">
            <h3 class="text-lg font-semibold mb-3 dark:text-white">Select Coach</h3>
            <div class="flex overflow-x-auto space-x-2 pb-2">
                <button class="px-4 py-2 bg-primary-light dark:bg-primary-dark text-white rounded-material whitespace-nowrap">A1 (3A)</button>
                <button class="px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-material whitespace-nowrap">B1 (3A)</button>
                <button class="px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-material whitespace-nowrap">A2 (2A)</button>
                <button class="px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-material whitespace-nowrap">B2 (2A)</button>
            </div>
        </div>

        <!-- Seat Selection -->
        <div>
            <h3 class="text-lg font-semibold mb-3 dark:text-white">Select Seats (Coach A1)</h3>
            
            <!-- Coach Layout -->
            <div class="material-card bg-white dark:bg-gray-800 p-4 mb-4">
                <div class="flex justify-between items-center mb-4">
                    <div>
                        <p class="text-sm text-gray-500 dark:text-gray-400">Coach</p>
                        <p class="font-medium dark:text-white">A1 (3AC - 72 Berths)</p>
                    </div>
                    <div>
                        <p class="text-sm text-gray-500 dark:text-gray-400">Available</p>
                        <p class="font-medium dark:text-white text-green-500">24 seats</p>
                    </div>
                </div>
                
                <!-- Seat Grid -->
                <div class="grid grid-cols-10 gap-2 mb-4">
                    <!-- Row 1 -->
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="1">1</div>
                    </div>
                    <div class="col-span-2"></div>
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="2">2</div>
                    </div>
                    
                    <!-- Row 2 -->
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-booked text-white" data-seat="3">3</div>
                    </div>
                    <div class="col-span-2"></div>
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="4">4</div>
                    </div>
                    
                    <!-- Row 3 -->
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="5">5</div>
                    </div>
                    <div class="col-span-2"></div>
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="6">6</div>
                    </div>
                    
                    <!-- Row 4 -->
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="7">7</div>
                    </div>
                    <div class="col-span-2 flex justify-center">
                        <div class="w-16 h-px bg-gray-300 dark:bg-gray-600 rotate-90"></div>
                    </div>
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="8">8</div>
                    </div>
                    
                    <!-- Row 5 -->
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-booked text-white" data-seat="9">9</div>
                    </div>
                    <div class="col-span-2"></div>
                    <div class="col-span-4 flex justify-center">
                        <div class="seat seat-available text-white" data-seat="10">10</div>
                    </div>
                </div>
                
                <!-- Berth Legend -->
                <div class="flex justify-center space-x-4 text-xs text-gray-500 dark:text-gray-400">
                    <div class="flex items-center space-x-1">
                        <div class="w-3 h-3 border border-gray-400"></div>
                        <span>Lower</span>
                    </div>
                    <div class="flex items-center space-x-1">
                        <div class="w-3 h-3 border border-gray-400 border-b-0"></div>
                        <span>Middle</span>
                    </div>
                    <div class="flex items-center space-x-1">
                        <div class="w-3 h-3 border border-gray-400 border-t-0"></div>
                        <span>Upper</span>
                    </div>
                </div>
            </div>
            
            <!-- Passenger Details -->
            <div class="material-card bg-white dark:bg-gray-800 p-4">
                <h3 class="text-lg font-semibold mb-3 dark:text-white">Passenger Details</h3>
                <div class="space-y-3">
                    <div>
                        <label class="block text-sm font-medium mb-1 dark:text-gray-300">Name</label>
                        <input type="text" class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white" placeholder="Full Name">
                    </div>
                    <div>
                        <label class="block text-sm font-medium mb-1 dark:text-gray-300">Age</label>
                        <input type="number" class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white" placeholder="Age">
                    </div>
                    <div>
                        <label class="block text-sm font-medium mb-1 dark:text-gray-300">Gender</label>
                        <select class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
                            <option>Male</option>
                            <option>Female</option>
                            <option>Other</option>
                        </select>
                    </div>
                    <div>
                        <label class="block text-sm font-medium mb-1 dark:text-gray-300">Berth Preference</label>
                        <select class="w-full p-3 border rounded-material bg-gray-50 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
                            <option>No Preference</option>
                            <option>Lower</option>
                            <option>Middle</option>
                            <option>Upper</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <!-- Enhanced Sticky Bottom Bar -->
    <div class="sticky-bottom-bar dark:bg-gray-800 dark:border-gray-700 shadow-lg">
        <div class="flex justify-between items-center max-w-6xl mx-auto px-4">
            <div>
                <p class="text-sm text-gray-500 dark:text-gray-400">Selected: <span class="font-medium dark:text-white" id="selected-count">0</span> seats</p>
                <p class="font-bold text-xl dark:text-white">₹<span id="total-price">0</span></p>
            </div>
            <button class="bg-primary-light dark:bg-accent text-white py-3 px-8 rounded-material font-medium hover:bg-opacity-90 transition shadow-md hover:shadow-lg flex items-center space-x-2">
                <i data-feather="credit-card" class="w-5 h-5"></i>
                <span>Continue to Payment</span>
            </button>
        </div>
    </div>
    <!-- Enhanced Navigation Rail (Tablet/Desktop) -->
    <nav class="hidden md:flex fixed left-0 top-0 h-full w-24 py-6 flex-col items-center bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700 z-40">
        <div class="mb-10 mt-4">
            <i data-feather="train" class="w-10 h-10 text-primary-light dark:text-accent"></i>
        </div>
        <div class="flex flex-col items-center space-y-10 w-full">
            <a href="index.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
                <i data-feather="home" class="w-7 h-7"></i>
                <span class="text-sm mt-1 font-medium">Home</span>
            </a>
            <a href="book.html" class="flex flex-col items-center text-primary-light dark:text-accent w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
                <i data-feather="book-open" class="w-7 h-7"></i>
                <span class="text-sm mt-1 font-medium">Bookings</span>
            </a>
            <a href="status.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
                <i data-feather="map-pin" class="w-7 h-7"></i>
                <span class="text-sm mt-1 font-medium">Status</span>
            </a>
            <a href="profile.html" class="flex flex-col items-center text-gray-500 dark:text-gray-400 w-full py-3 rounded-lg transition-all hover:bg-gray-100 dark:hover:bg-gray-700">
                <i data-feather="user" class="w-7 h-7"></i>
                <span class="text-sm mt-1 font-medium">Profile</span>
            </a>
</div>
    </nav>

    <script>
        // Seat selection logic
        const seats = document.querySelectorAll('.seat');
        let selectedSeats = 0;
        const pricePerSeat = 1850;
        
        seats.forEach(seat => {
            seat.addEventListener('click', () => {
                if (seat.classList.contains('seat-available')) {
                    seat.classList.remove('seat-available');
                    seat.classList.add('seat-selected');
                    selectedSeats++;
                } else if (seat.classList.contains('seat-selected')) {
                    seat.classList.remove('seat-selected');
                    seat.classList.add('seat-available');
                    selectedSeats--;
                }
                
                document.getElementById('selected-count').textContent = selectedSeats;
                document.getElementById('total-price').textContent = selectedSeats * pricePerSeat;
            });
        });
        
        // Theme toggle
        const themeToggle = document.getElementById('theme-toggle');
        const html = document.documentElement;
        
        themeToggle.addEventListener('click', () => {
            html.classList.toggle('dark');
            localStorage.theme = html.classList.contains('dark') ? 'dark' : 'light';
        });
        
        // Feather icons
        feather.replace();
    </script>
</body>
</html>