/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    background: #f8f9fa;
}

.search-box input:focus {
    background: #e9ecef;
}

.search-box button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-box button:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* VIP Message Container Styles */
.message-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    max-width: 90%;
    width: auto;
    min-width: 400px;
    animation: messageSlideIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.message-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: messageShine 3s ease-in-out infinite;
}

/* Success Message */
.message-container.success .message-content {
    background: linear-gradient(135deg, #00b894, #00cec9, #74b9ff);
    color: white;
    animation: successPulse 2s ease-in-out infinite;
}

/* Error Message */
.message-container.error .message-content {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52, #fd79a8);
    color: white;
    animation: errorShake 0.5s ease-in-out;
}

/* Info Message */
.message-container.info .message-content {
    background: linear-gradient(135deg, #74b9ff, #0984e3, #6c5ce7);
    color: white;
    animation: infoBounce 0.6s ease-out;
}

/* Warning Message */
.message-container.warning .message-content {
    background: linear-gradient(135deg, #fdcb6e, #e17055, #ff9f43);
    color: white;
    animation: warningPulse 1s ease-in-out infinite;
}

.message-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    animation: iconRotate 2s ease-in-out infinite;
}

.message-body {
    flex: 1;
    text-align: center;
}

.message-text {
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.message-close {
    margin-left: 20px;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.2) rotate(90deg);
}

/* Animations */
@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

@keyframes messageShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes successPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 20px 60px rgba(0,184,148,0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 25px 70px rgba(0,184,148,0.5);
    }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes infoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes warningPulse {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.01);
        filter: brightness(1.1);
    }
}

@keyframes iconRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.1); }
    75% { transform: rotate(5deg) scale(1.1); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .message-container {
        min-width: 300px;
        max-width: 95%;
    }
    
    .message-content {
        padding: 20px 25px;
    }
    
    .message-icon {
        font-size: 2rem;
        margin-right: 15px;
    }
    
    .message-text {
        font-size: 1.2rem;
    }
    
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.toggle-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.3);
}

.card-content {
    padding: 25px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.info-item.highlight {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left-color: #2196f3;
    font-weight: 600;
}

.info-item label {
    font-weight: 600;
    color: #495057;
}

.info-item span {
    color: #212529;
    font-weight: 500;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

table tr:hover {
    background: #f8f9fa;
}

table td {
    color: #212529;
}

/* Charges Section */
.charges-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.charges-grid {
    display: grid;
    gap: 15px;
}

.charge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #28a745;
}

.charge-item label {
    font-weight: 600;
    color: #495057;
}

.charge-item span {
    color: #28a745;
    font-weight: 600;
}

/* Raw JSON Styles */
#rawJson {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .search-box input,
    .search-box button {
        border-radius: 10px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .charges-section {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .card-content {
        padding: 15px;
    }
    
    .search-box {
        padding: 8px;
    }
    
    .search-box input,
    .search-box button {
        padding: 12px 15px;
    }
    
    .footer-content p {
        font-size: 1.1rem;
    }
    
    .footer-content .footer-subtitle {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 30px 15px;
    }
}

/* Animation for cards appearing */
.bill-data {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.4;
}

.footer-content .footer-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 12px;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.footer-content i {
    color: #ff6b6b;
    margin-right: 10px;
    font-size: 1.2em;
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.footer-content strong {
    color: #ffd93d;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
