/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    color: var(--text-primary);
    padding: 0;
    margin: 0;
}

/* Main content container - only apply to the main content div */
body > .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Override container styles for navbar to use Bootstrap defaults */
.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding-right: 15px;
    padding-left: 15px;
}



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

.title {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: bounceOnce 2s ease-out;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes bounceOnce {
    0% { transform: translateY(0); }
    20% { transform: translateY(-15px); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-10px); }
    80% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

/* Domain Management */
.domain-management {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.add-domain-btn,
.manage-domains-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    font-size: 1rem;
}

.add-domain-btn {
    background: var(--gradient-secondary);
    border-color: rgba(255, 255, 255, 0.3);
}

.manage-domains-btn {
    background: var(--gradient-cool);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--dark-slate-gray);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.add-domain-btn:hover,
.manage-domains-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.add-domain-btn:hover {
    background: var(--gradient-warm);
}

.manage-domains-btn:hover {
    background: var(--gradient-accent);
}

/* Tabs Styles */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tab.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.tab i {
    margin-right: 8px;
}

/* Search Container */
.search-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.search-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.enhanced-query {
    background: var(--border-light);
    padding: 15px 20px;
    border-radius: 15px;
    border-left: 4px solid var(--primary);
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    display: none;
}

.enhanced-query.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Content Tabs */
.content-tabs {
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin: 20px 0;
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: var(--gradient-primary);
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.content-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 20px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.content-tab:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.content-tab.active {
    color: white;
    background: rgba(255,255,255,0.2);
    border-bottom: 3px solid white;
}

.tab-content {
    display: none;
    max-height: 500px;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.bookmark-count {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: normal;
}



.results-header,
.bookmarks-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.results,
.bookmarks {
    padding: 20px 30px;
    max-height: 400px;
    overflow-y: auto;
}

/* Result Items */
.result-item {
    background: var(--border-light);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.result-item:hover {
    background: var(--border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary);
}

.result-title {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.result-url {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    word-break: break-all;
}

.result-snippet {
    color: var(--text-muted);
    line-height: 1.5;
}

.result-content {
    flex: 1;
}

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

.btn-open, .btn-save {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-open {
    background: var(--gradient-primary);
    color: white;
}

.btn-open:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-save:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-save.saved {
    background: #6c757d;
    cursor: default;
}

.btn-save.saved:hover {
    transform: none;
    box-shadow: none;
}

/* Bookmark Items */
.bookmark-item {
    background: var(--border-light);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--success);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bookmark-item:hover {
    background: var(--border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--success);
}

.bookmark-info {
    flex: 1;
}

.bookmark-title {
    color: var(--success);
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.bookmark-url {
    color: var(--text-secondary);
    font-size: 0.9rem;
    word-break: break-all;
}

.remove-bookmark {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-bookmark:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Domain List Styles */
.domain-item {
    background: var(--border-light);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.domain-info {
    flex: 1;
}

.domain-name {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.domain-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.domain-actions {
    display: flex;
    gap: 10px;
}

.domain-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.edit-domain {
    background: #ffc107;
    color: #212529;
}

.edit-domain:hover {
    background: #e0a800;
    transform: scale(1.05);
}

.delete-domain {
    background: #dc3545;
    color: white;
}

.delete-domain:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

.modal-footer {
    padding: 20px 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: var(--border-light);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn.primary {
    background: var(--gradient-primary);
    color: white;
}

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

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

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body > .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .domain-management {
        flex-direction: column;
        align-items: center;
    }
    
    .tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab {
        width: 100%;
        max-width: 300px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .domain-actions {
        flex-direction: column;
        gap: 5px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Scrollbar Styling */
.results::-webkit-scrollbar,
.bookmarks::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.results::-webkit-scrollbar-track,
.bookmarks::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.results::-webkit-scrollbar-thumb,
.bookmarks::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.results::-webkit-scrollbar-thumb:hover,
.bookmarks::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
