/* WAPDA Bill Viewer Plugin Styles */

/* Reset and Base Styles */
.wapda-bill-viewer-container * {
    box-sizing: border-box;
}

.wapda-bill-viewer-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    color: #333;
    line-height: 1.6;
    margin: 20px 0;
}

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

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

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

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

.wapda-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);
}

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

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

.wapda-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;
}

.wapda-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 */
.wapda-loading {
    text-align: center;
    padding: 40px;
    color: white;
}

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

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

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

.wapda-message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    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;
    background: linear-gradient(135deg, #00b894, #00cec9, #74b9ff);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.wapda-message-content.error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52, #fd79a8);
}

.wapda-message-content.warning {
    background: linear-gradient(135deg, #fdcb6e, #e17055, #ff9f43);
}

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

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

/* Card Styles */
.wapda-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;
}

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

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

.wapda-card-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.wapda-card-content {
    padding: 25px;
}

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

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

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

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

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

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

.wapda-bill-viewer-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.wapda-bill-viewer-container table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.wapda-bill-viewer-container table tr:hover {
    background: #f8f9fa;
}

.wapda-bill-viewer-container table td {
    color: #212529;
}

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

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

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

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

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

/* PDF Section Styles */
.wapda-pdf-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    overflow: hidden;
    border: 2px solid #e74c3c;
}

.wapda-pdf-controls {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    padding: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.wapda-pdf-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.wapda-pdf-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.wapda-pdf-btn i {
    font-size: 1.2em;
}

.wapda-download-btn:hover {
    background: #27ae60;
    border-color: #27ae60;
}

.wapda-print-btn:hover {
    background: #3498db;
    border-color: #3498db;
}

.wapda-view-active {
    background: rgba(255,255,255,0.4) !important;
    border-color: rgba(255,255,255,0.6) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
}

.wapda-pdf-viewer {
    background: white;
    border-top: 1px solid #dee2e6;
}

.wapda-pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.wapda-pdf-title h4 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 1.2rem;
}

.wapda-pdf-instructions {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

.wapda-pdf-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wapda-action-btn {
    background: #6c757d;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.wapda-action-btn:hover {
    background: #495057;
    transform: scale(1.05);
}

.wapda-close-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.wapda-close-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.wapda-pdf-container {
    position: relative;
}

.wapda-pdf-viewer iframe {
    border: none;
    width: 100%;
    min-height: 600px;
    background: #f8f9fa;
}

/* Fullscreen PDF Viewer */
.wapda-pdf-viewer.wapda-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: white;
    border-radius: 0;
    margin: 0;
}

.wapda-pdf-viewer.wapda-fullscreen iframe {
    height: calc(100vh - 70px);
    min-height: calc(100vh - 70px);
}

.wapda-pdf-viewer.wapda-fullscreen .wapda-pdf-header {
    position: sticky;
    top: 0;
    z-index: 10001;
}

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

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

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

.wapda-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: wapda-shimmer 3s ease-in-out infinite;
}

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

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

.wapda-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;
}

.wapda-footer-content .wapda-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;
}

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

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

.wapda-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);
}

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

@media (max-width: 480px) {
    .wapda-header h2 {
        font-size: 1.8rem;
    }
    
    .wapda-card-content {
        padding: 15px;
    }
    
    .wapda-search-box {
        padding: 8px;
    }
    
    .wapda-search-box input,
    .wapda-search-box button {
        padding: 12px 15px;
    }
    
    .wapda-footer-content p {
        font-size: 1.1rem;
    }
    
    .wapda-footer-content .wapda-footer-subtitle {
        font-size: 0.9rem;
    }
    
    .wapda-footer {
        padding: 30px 15px;
    }
    
    .wapda-pdf-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .wapda-pdf-btn {
        justify-content: center;
        padding: 15px 20px;
    }
    
    .wapda-pdf-viewer iframe {
        min-height: 400px;
    }
    
    .wapda-pdf-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .wapda-pdf-actions {
        justify-content: center;
    }
    
    .wapda-pdf-instructions {
        font-size: 0.8rem;
    }
    
    .wapda-pdf-viewer.wapda-fullscreen iframe {
        height: calc(100vh - 120px);
        min-height: calc(100vh - 120px);
    }
}

/* Compact Theme */
.wapda-theme-compact {
    background: #f8f9fa;
    color: #333;
}

.wapda-theme-compact .wapda-header {
    color: #333;
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.wapda-theme-compact .wapda-header h2 {
    color: #495057;
    text-shadow: none;
}

.wapda-theme-compact .wapda-card {
    margin-bottom: 15px;
}

.wapda-theme-compact .wapda-card-header {
    background: #495057;
    padding: 15px 20px;
}

.wapda-theme-compact .wapda-card-content {
    padding: 20px;
}

.wapda-theme-compact .wapda-footer {
    background: #495057;
    padding: 30px 20px;
}
