/* Seller Portal Styles */

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

html {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
}

body {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #f8f8f8 0%, #efefef 50%, #e8e8e8 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    padding-top: calc(70px + env(safe-area-inset-top));
}

/* Subtle dot pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(139, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* Navbar - Matching main site */
.top-nav {
    background: linear-gradient(135deg, #3b030d 0%, #5e0918 25%, #7c0f23 50%, #5e0918 75%, #3b030d 100%);
    color: white;
    padding: 12px 0;
    padding-top: calc(12px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(59, 3, 13, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Subtle shimmer effect on navbar */
.top-nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: navShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes navShimmer {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-icon {
    height: 40px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .logo-icon {
        height: 32px;
    }
}

/* Back button in navbar */
.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.2s;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-back-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 480px) {
    .nav-back-btn span {
        display: none;
    }
    .nav-back-btn {
        padding: 8px;
    }
}

/* Main Content */
.portal-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 25px 20px;
    position: relative;
    z-index: 1;
}

/* Limit Banner */
.limit-banner {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 0, 0, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.06), 0 1px 3px rgba(0,0,0,0.04);
}

.limit-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.limit-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color, #8B0000);
}

.limit-label {
    font-size: 14px;
    color: #666;
}

.limit-bar {
    height: 10px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.limit-progress {
    height: 100%;
    background: linear-gradient(90deg, #8B0000, #c9a227);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* Sections */
.portal-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 0, 0, 0.08);
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.06), 0 1px 3px rgba(0,0,0,0.04);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.08);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.section-header h2 svg {
    width: 20px;
    height: 20px;
    color: #8B0000;
}

.section-content {
    padding: 20px;
}

/* Upload Section */
.upload-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.92) 100%);
    border: 1px solid rgba(139, 0, 0, 0.12);
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.08);
}

.upload-icon-wrapper {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8B0000, #a50000);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
}

.upload-icon-wrapper svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.upload-header-text h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.upload-header-text p {
    font-size: 13px;
    color: #888;
}

.upload-content {
    padding: 24px;
}

/* Plate Preview */
.plate-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.plate-preview-inner {
    width: 100%;
    max-width: 280px;
    height: 100px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
    border: 3px solid rgba(139, 0, 0, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.plate-preview-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent);
    pointer-events: none;
}

.plate-preview-inner span {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Upload Form */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.form-group label svg {
    width: 16px;
    height: 16px;
    color: #8B0000;
}

.form-group input {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid rgba(139, 0, 0, 0.15);
    border-radius: 12px;
    color: #333;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-group input:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-group input.readonly {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox styling */
.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #8B0000, #a50000);
    border-color: #8B0000;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: #8B0000;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #8B0000, #a50000);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
    margin-top: 8px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(139, 0, 0, 0.5);
    background: linear-gradient(135deg, #9d0000, #b50000);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn svg {
    width: 20px;
    height: 20px;
}

/* Status Message */
.status-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 12px;
    display: none;
}

.status-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #16a34a;
}

.status-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #dc2626;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: #888;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(139, 0, 0, 0.1);
    border-top-color: #8B0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    color: #ccc;
}

/* Plates Grid - Using card.css grid styling */
.plates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .plates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 500px) {
    .plates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Seller card action buttons overlay */
.seller-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.plate-card:hover .seller-card-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Always show on mobile */
@media (max-width: 768px) {
    .seller-card-actions {
        opacity: 1;
        transform: translateY(0);
    }
}

.seller-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.seller-action-btn svg {
    width: 18px;
    height: 18px;
}

.seller-action-btn.edit-btn {
    color: #3b82f6;
}

.seller-action-btn.edit-btn:hover {
    background: #3b82f6;
    color: #fff;
}

.seller-action-btn.delete-btn {
    color: #dc2626;
}

.seller-action-btn.delete-btn:hover {
    background: #dc2626;
    color: #fff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #fff;
    border: 1px solid rgba(139, 0, 0, 0.1);
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-modal {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: rgba(139, 0, 0, 0.08);
    color: #8B0000;
}

.close-modal svg {
    width: 20px;
    height: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-secondary {
    flex: 1;
    padding: 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 12px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #eee;
    border-color: #ccc;
}

.btn-primary {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #8B0000, #a50000);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 18px rgba(139, 0, 0, 0.35);
}

.btn-danger {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

.delete-modal p {
    color: #555;
    margin-bottom: 8px;
}

.delete-modal strong {
    color: var(--primary-color, #8B0000);
}

.warning-text {
    font-size: 13px;
    color: #999;
}

/* Not Authorized */
.not-authorized {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #f8f8f8 0%, #efefef 50%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.not-auth-content {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(139, 0, 0, 0.1);
    max-width: 400px;
    margin: 20px;
}

.not-auth-content svg {
    width: 70px;
    height: 70px;
    color: #dc2626;
    margin-bottom: 20px;
}

.not-auth-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #333;
}

.not-auth-content p {
    color: #666;
    margin-bottom: 24px;
}

.back-home-btn {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #8B0000, #a50000);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.25);
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.35);
}

/* Responsive */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .user-phone {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .portal-main {
        padding: 16px;
    }
    
    .plate-number {
        font-size: 18px;
    }
}
