/* ============================================
   CONVIX DUPLICATE IP CHECKER - COMPLETE CSS
   Fresh, Clean, Error-Free Version
============================================ */

/* 1. RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 2. CONTAINERS */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.manage-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 3. HEADER STYLES */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 2.5rem;
    color: #4dabf7;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.app-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #60a5fa, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.5px;
}

.app-subtitle {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 300;
    margin-top: 5px;
}

/* 4. MAIN CONTENT LAYOUT */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* 5. CHECKER SECTION */
.checker-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

/* 6. CARDS */
.input-card, .list-card, .stat-card, .add-account-form, .accounts-list {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.input-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-description {
    color: #94a3b8;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 7. FORM STYLES */
.ip-form {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #60a5fa;
    font-size: 1rem;
}

/* 8. INPUT FIELDS */
.ip-input, .network-select, .account-select, .account-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid #334155;
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.ip-input:focus, .network-select:focus, .account-select:focus, .account-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.ip-input:focus {
    border-color: #4dabf7;
}

.account-select:focus, .account-input:focus {
    border-color: #9333ea;
}

.ip-input::placeholder, .account-input::placeholder {
    color: #64748b;
    opacity: 0.8;
}

.input-hint {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
}

/* 9. SELECT WRAPPER */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper .select-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #60a5fa;
    pointer-events: none;
    font-size: 0.9rem;
}

.network-select, .account-select {
    appearance: none;
    padding-right: 50px;
    cursor: pointer;
    background-image: none;
}

.network-select:focus {
    border-color: #4dabf7;
}

.account-select:focus {
    border-color: #9333ea;
}

/* 10. INFO BOX */
.info-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #475569;
    border-radius: 10px;
    padding: 15px;
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.info-box p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box i {
    color: #60a5fa;
    font-size: 0.9rem;
}

/* 11. FORM ACTIONS */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.check-btn {
    padding: 16px 40px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    justify-content: center;
}

.check-btn:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.check-btn:active {
    transform: translateY(0);
}

/* 12. CLEAR BUTTON */
.clear-btn {
    padding: 16px 25px;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

/* 13. TEST SECTION */
.test-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.test-label {
    color: #94a3b8;
    margin-bottom: 15px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-label i {
    color: #60a5fa;
}

.test-buttons-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.test-btn {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    border: 1px solid #475569;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.test-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

/* 14. RESULT MESSAGES */
.result-message {
    padding: 22px;
    border-radius: 12px;
    margin-top: 25px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-text {
    font-size: 1.05rem;
    color: inherit;
    line-height: 1.5;
}

/* 15. RESULT DETAILS */
.result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.detail-item strong {
    font-weight: 600;
    color: inherit;
}

/* 16. MESSAGE TYPES */
.duplicate-message {
    background: rgba(220, 38, 38, 0.15);
    border-left: 4px solid #ef4444;
    color: #fca5a5;
}

.duplicate-message .detail-item {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.unique-message {
    background: rgba(34, 197, 94, 0.15);
    border-left: 4px solid #22c55e;
    color: #86efac;
}

.unique-message .detail-item {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.error-message {
    background: rgba(245, 158, 11, 0.15);
    border-left: 4px solid #f59e0b;
    color: #fde68a;
}

.error-message .detail-item {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-message i {
    font-size: 1.6rem;
    margin-top: 2px;
}

/* 17. STATS SECTION */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-content h3 {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #e2e8f0;
}

/* 18. HISTORY SECTION */
.history-section {
    margin-top: 10px;
}

.card-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.3rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 19. TABLE STYLES */
.table-container {
    padding: 0;
}

.ip-table {
    width: 100%;
    border-collapse: collapse;
}

.ip-table thead {
    background: rgba(30, 41, 59, 0.8);
}

.ip-table th {
    padding: 18px 25px;
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.ip-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.ip-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.6);
}

.ip-table td {
    padding: 18px 25px;
    color: #e2e8f0;
    vertical-align: middle;
}

/* 20. TABLE CELLS */
.ip-cell, .network-cell, .time-cell, .account-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ip-cell i, .network-cell i, .time-cell i, .account-cell i {
    color: #60a5fa;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.network-cell {
    font-weight: 500;
}

.account-cell i {
    color: #9333ea;
}

.no-account {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.9rem;
}

/* 21. STATUS BADGES */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

.status-duplicate {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-unique {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-error {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 22. EMPTY STATE */
.empty-state {
    padding: 60px 25px;
    text-align: center;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* 23. FOOTER */
.app-footer {
    margin-top: 50px;
    text-align: center;
    padding: 25px;
    color: #94a3b8;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-info {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* 24. ACCOUNT MANAGEMENT SPECIFIC */
.network-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.network-tab {
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #475569;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.network-tab:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: #3b82f6;
}

.network-tab.active {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border-color: #3b82f6;
    font-weight: 600;
}

.network-tab .count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.management-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.accounts-list h3 {
    margin-bottom: 20px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.account-item {
    background: rgba(30, 41, 59, 0.6);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #475569;
    transition: all 0.3s ease;
}

.account-item:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #60a5fa;
}

.account-name {
    font-weight: 500;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.default-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.empty-accounts {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
}

.empty-accounts i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #60a5fa;
    text-decoration: none;
    margin-bottom: 20px;
    padding: 10px 0;
}

.back-link:hover {
    color: #93c5fd;
}

/* 25. RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .container, .manage-container {
        padding: 15px;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .form-row, .management-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .check-btn, .clear-btn {
        width: 100%;
        min-width: auto;
        justify-content: center;
    }
    
    .clear-btn {
        margin-left: 0;
    }
    
    .ip-table {
        display: block;
        overflow-x: auto;
    }
    
    .test-buttons-group {
        justify-content: center;
    }
    
    .result-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .detail-item {
        width: 100%;
        justify-content: space-between;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .input-card, .add-account-form, .accounts-list {
        padding: 25px;
    }
    
    .network-tabs {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        font-size: 2rem;
        padding: 12px;
    }
    
    .test-buttons-group {
        justify-content: flex-start;
    }
    
    .test-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .ip-input, .network-select, .account-select, .account-input {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* 26. ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 27. SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* 28. SELECTION */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #e2e8f0;
}

/* 29. FOCUS VISIBLE */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 30. PRINT STYLES */
@media print {
    .check-btn, .clear-btn, .test-btn, .delete-btn,
    .network-tabs, .back-link, .test-section {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .app-header, .input-card, .list-card, .stat-card,
    .add-account-form, .accounts-list {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: white !important;
        color: black !important;
    }
}

/* Add this to your existing CSS file */
.manage-btn {
    padding: 16px 25px;
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 180px;
    justify-content: center;
}

.manage-btn:hover {
    background: linear-gradient(135deg, #7e22ce, #a855f7);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.manage-btn:active {
    transform: translateY(0);
}

/* Update form-actions to include space for the manage button */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Status badges with gradients */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.status-duplicate {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.status-blocked {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    border: 1px solid rgba(185, 28, 28, 0.3);
    animation: pulse 2s infinite;
}

.status-unique {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-error {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Test button for blocked IP */
.test-btn-blocked {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border-color: #ef4444;
    position: relative;
    overflow: hidden;
}

.test-btn-blocked:hover {
    background: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
    border-color: #ef4444;
}

/* Form actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Pulse animation for blocked status */
@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .check-btn, .clear-btn, .manage-btn {
        width: 100%;
        min-width: auto;
    }
    
    .status-badge {
        min-width: 70px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}