/* GST Invoice Manager Public Styles */

/* General Styles */
.gim-public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Invoice Portal Styles */
.gim-invoice-portal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.gim-invoice-portal h2 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.gim-invoice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gim-invoice-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.gim-invoice-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.gim-invoice-card h3 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 1.2em;
}

.gim-invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.gim-invoice-meta span {
    color: #666;
}

.gim-invoice-amount {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.gim-invoice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Customer Portal Styles */
.gim-customer-portal {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px 0;
}

.gim-portal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.gim-portal-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.gim-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gim-stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #0073aa;
}

.gim-stat-card.warning {
    border-left-color: #ffc107;
}

.gim-stat-card.danger {
    border-left-color: #dc3545;
}

.gim-stat-card.success {
    border-left-color: #28a745;
}

.gim-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    color: #333;
}

.gim-stat-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Styles */
.gim-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.gim-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.gim-table tbody tr:hover {
    background: #f8f9fa;
}

.gim-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.gim-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.gim-status.paid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.gim-status.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.gim-status.overdue {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.gim-status.partially_paid {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.gim-status.cancelled {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Button Styles */
.gim-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.gim-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gim-btn.primary {
    background: #0073aa;
    color: white;
}

.gim-btn.success {
    background: #28a745;
    color: white;
}

.gim-btn.warning {
    background: #ffc107;
    color: #000;
}

.gim-btn.danger {
    background: #dc3545;
    color: white;
}

.gim-btn.secondary {
    background: #6c757d;
    color: white;
}

.gim-btn.outline {
    background: transparent;
    border: 1px solid #0073aa;
    color: #0073aa;
}

.gim-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

.gim-btn.large {
    padding: 12px 24px;
    font-size: 16px;
}

/* Payment Buttons */
.gim-payment-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.gim-payment-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.gim-payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gim-payment-btn.razorpay {
    background: #3395ff;
    color: white;
}

.gim-payment-btn.payu {
    background: #00c851;
    color: white;
}

.gim-payment-btn.instamojo {
    background: #ff4444;
    color: white;
}

.gim-payment-btn.paytm {
    background: #00baf2;
    color: white;
}

/* Filter Buttons */
.gim-filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gim-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.gim-filter-btn:hover,
.gim-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Loading States */
.gim-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.gim-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Alerts and Messages */
.gim-alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.gim-alert.success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.gim-alert.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.gim-alert.warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.gim-alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gim-public-container {
        padding: 10px;
    }
    
    .gim-invoice-grid {
        grid-template-columns: 1fr;
    }
    
    .gim-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gim-invoice-meta {
        grid-template-columns: 1fr;
    }
    
    .gim-invoice-actions {
        flex-direction: column;
    }
    
    .gim-payment-buttons {
        flex-direction: column;
    }
    
    .gim-payment-btn {
        width: 100%;
    }
    
    .gim-table {
        font-size: 14px;
    }
    
    .gim-table th,
    .gim-table td {
        padding: 10px 8px;
    }
    
    .gim-portal-header h1 {
        font-size: 2em;
    }
    
    .gim-filter-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gim-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .gim-stat-card h3 {
        font-size: 1.8em;
    }
    
    .gim-table {
        font-size: 12px;
    }
    
    .gim-table th,
    .gim-table td {
        padding: 8px 6px;
    }
    
    .gim-portal-header {
        padding: 30px 15px;
    }
    
    .gim-portal-header h1 {
        font-size: 1.8em;
    }
}

/* Print Styles */
@media print {
    .gim-no-print {
        display: none !important;
    }
    
    .gim-public-container {
        max-width: none;
        padding: 0;
    }
    
    .gim-invoice-portal {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gim-invoice-portal {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .gim-table {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .gim-table th {
        background: #4a5568;
    }
    
    .gim-table tbody tr:hover {
        background: #4a5568;
    }
    
    .gim-stat-card {
        background: #2d3748;
        color: #e2e8f0;
    }
}

/* Accessibility */
.gim-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gim-btn:focus,
.gim-payment-btn:focus,
.gim-filter-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .gim-btn,
    .gim-payment-btn {
        border: 2px solid;
    }
    
    .gim-status {
        border: 2px solid;
    }
    
    .gim-table th,
    .gim-table td {
        border: 1px solid #000;
    }
}