/* NSDL PAN Plugin Frontend Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
}

.nsdl-user-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.nsdl-user-nav {
    background: #1e40af;
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nsdl-user-nav .nav-brand {
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nsdl-user-nav h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    border-right: 1px solid rgba(255,255,255,0.1);
}

.nav-menu a {
    display: block;
    padding: 1rem 2rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Main Content */
.nsdl-user-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-header,
.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.dashboard-header h1,
.page-header h1 {
    font-size: 2.5rem;
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.dashboard-header p,
.page-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.header-actions {
    margin-top: 1rem;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.stat-card small {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.25rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-outline:hover {
    background: #3b82f6;
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Forms */
.registration-card,
.pan-form,
.recharge-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    color: #1e40af;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Tables */
.transactions-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.transactions-table th,
.transactions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.transactions-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.transactions-table tbody tr:hover {
    background: #f8fafc;
}

/* API Key Display */
.api-key-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.api-key-display code {
    flex: 1;
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-family: 'Monaco', 'Menlo', monospace;
}

.copy-btn {
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.copy-btn:hover {
    background: #2563eb;
}

/* Recharge Page */
.amount-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.amount-btn {
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.amount-btn:hover,
.amount-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.payment-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-option {
    display: block;
    cursor: pointer;
}

.payment-card {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.payment-option input:checked + .payment-card {
    border-color: #3b82f6;
    background: #eff6ff;
}

.recharge-summary {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-item.total {
    font-weight: 600;
    font-size: 1.125rem;
    padding-top: 0.5rem;
    border-top: 1px solid #d1d5db;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fecaca;
    color: #991b1b;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #374151;
}

/* Filters */
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

/* Registration Page */
.nsdl-registration-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.registration-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 100%;
}

.card-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.card-header h1 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.card-footer {
    text-align: center;
    padding: 1rem 2rem 2rem;
    color: #64748b;
}

.card-footer a {
    color: #3b82f6;
    text-decoration: none;
}

.card-footer a:hover {
    text-decoration: underline;
}

/* Messages */
.nsdl-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10000;
    max-width: 400px;
}

.nsdl-message.success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.nsdl-message.error {
    background: #fecaca;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn.loading {
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nsdl-user-nav {
        flex-direction: column;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu li {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nsdl-user-main {
        padding: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .amount-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-header h1,
    .page-header h1 {
        font-size: 2rem;
    }
    
    .nsdl-registration-container {
        padding: 1rem;
    }
    
    .registration-card {
        margin: 0;
    }
    
    .amount-buttons {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a;
        color: #e2e8f0;
    }
    
    .stat-card,
    .registration-card,
    .transactions-table {
        background: #1e293b;
        color: #e2e8f0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }
}