/* CodeRealtor Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 50vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* Cards */
.card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Domain Cards */
.domain-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.domain-card:hover {
    border-left-color: var(--primary-color);
    transform: translateY(-3px);
}

.domain-name h5 {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.1rem;
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Button Styles */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Badge Styles */
.badge {
    border-radius: 6px;
    font-weight: 500;
}

/* Error Page Styles */
.error-page {
    padding: 60px 0;
}

.error-page .display-1 {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Toast Notification */
.toast-notification {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 40vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .error-page .display-1 {
        font-size: 5rem;
    }
    
    .feature-card {
        margin-bottom: 2rem;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Character Counter */
.form-text .float-end {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

/* Social Links */
.social-links a {
    transition: all 0.3s ease;
    opacity: 0.7;
    display: inline-block;
    font-size: 1.25rem;
    text-decoration: none !important;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Font Awesome icon fallback */
.social-links a i {
    display: inline-block;
    width: 1.5em;
    text-align: center;
}

/* Ensure icons display properly */
.social-links a i:before {
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Hide screen reader text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Domain Extensions Styling */
.domain-extension-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: move;
}

.domain-extension-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.domain-extension-item.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.extension-label {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
    cursor: pointer;
}

.drag-handle {
    cursor: move;
    color: #6c757d;
    transition: color 0.3s ease;
}

.drag-handle:hover {
    color: var(--primary-color);
}

/* Custom badges */
.badge.bg-purple {
    background-color: #6f42c1 !important;
}

.badge.bg-gradient {
    background: linear-gradient(45deg, #667eea, #764ba2) !important;
}

/* Purpose selection styling */
#purpose {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#purpose:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#custom_purpose {
    border: 2px solid #ffc107;
    background-color: #fff9e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .domain-extension-item {
        padding: 10px;
    }
    
    .extension-label {
        font-size: 1rem;
    }
}

/* Domain Extension Selection Styles */
.domain-extension-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: move;
}

.domain-extension-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.domain-extension-item.selected {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.domain-extension-item.dragging {
    opacity: 0.7;
    transform: rotate(2deg);
    z-index: 1000;
}

.extension-label {
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.drag-handle {
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.drag-handle:hover {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Custom badge colors */
.badge.bg-purple {
    background-color: #6f42c1 !important;
    color: white;
}

.badge.bg-gradient {
    background: linear-gradient(45deg, #667eea, #764ba2) !important;
    color: white;
}

/* Purpose selection styles */
#custom_purpose {
    transition: all 0.3s ease;
}

#custom_purpose:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Sortable placeholder */
.sortable-placeholder {
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    height: 60px;
    margin-bottom: 8px;
}

/* Form enhancements */
.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Extension priority indicators */
.domain-extension-item::before {
    content: attr(data-priority);
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.domain-extension-item {
    position: relative;
    margin-left: 15px;
}

/* Custom TLD Addition Styles */
.custom-tld-section {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.custom-tld-input-group {
    max-width: 300px;
}

.remove-custom-tld {
    opacity: 0.7;
    transition: all 0.3s ease;
}

.remove-custom-tld:hover {
    opacity: 1;
    transform: scale(1.1);
}

.domain-extension-item[data-extension*="custom"] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #6c757d;
}

.domain-extension-item[data-extension*="custom"]:hover {
    border-color: var(--danger-color);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

/* TLD Error/Success Messages */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.alert-sm .fas {
    font-size: 0.75rem;
}

/* Animation for new TLD items */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.domain-extension-item.new-tld {
    animation: slideInFromRight 0.4s ease-out;
}

/* Custom TLD input styling */
#custom-tld-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
}

#custom-tld-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
}

/* Responsive adjustments for custom TLD */
@media (max-width: 768px) {
    .custom-tld-input-group {
        max-width: 100%;
    }
    
    .remove-custom-tld {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Purpose TLD Suggestions */
#purpose-tld-suggestions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

#purpose-tld-suggestions .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

#apply-suggested-tlds {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

#apply-suggested-tlds:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Purpose Selection Improvements */
#purpose option {
    padding: 0.5rem;
    font-weight: 500;
}

#purpose option[value=""] {
    color: #6c757d;
    font-style: italic;
}

/* Suggested TLD badges */
.badge.bg-light.text-dark {
    background-color: #28a745 !important;
    color: white !important;
}

.domain-extension-item .badge:contains("Suggested") {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
    color: white !important;
}

/* Animation for suggested TLDs */
.new-tld {
    animation: slideInFromRight 0.4s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* New TLD Selection Interface Styles */
.tld-column {
    height: 100%;
}

.tld-list {
    transition: all 0.3s ease;
}

.tld-item {
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.tld-item:last-child {
    margin-bottom: 0;
}

.tld-item .d-flex {
    transition: all 0.3s ease;
}

.tld-item:hover .d-flex {
    background-color: #f8f9fa !important;
    transform: translateX(2px);
}

.tld-item.selected .d-flex {
    background-color: #e8f5e8 !important;
    border-color: #28a745 !important;
}

.tld-item.available .d-flex {
    background-color: #ffffff;
    border-color: #dee2e6;
}

.tld-label {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    font-size: 0.9rem;
}

.move-tld {
    transition: all 0.3s ease;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.move-tld:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.move-tld[data-direction="add"] {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb !important;
}

.move-tld[data-direction="add"]:hover {
    background-color: #1976d2;
    color: white;
}

.move-tld[data-direction="remove"] {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02 !important;
}

.move-tld[data-direction="remove"]:hover {
    background-color: #f57c00;
    color: white;
}

#clear-selected-btn {
    transition: all 0.3s ease;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2 !important;
}

#clear-selected-btn:hover {
    background-color: #d32f2f;
    color: white;
    transform: scale(1.1);
}

#select-popular-btn {
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background-color: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffcc02 !important;
}

#select-popular-btn:hover {
    background-color: #f57c00;
    color: white;
    transform: translateY(-1px);
}

/* Mobile responsive adjustments for new TLD interface */
@media (max-width: 768px) {
    .tld-list {
        max-height: 200px !important;
        min-height: 150px !important;
    }
    
    .tld-item .d-flex {
        font-size: 0.85rem;
    }
    
    .tld-label {
        font-size: 0.8rem;
    }
    
    .badge.small {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
    }
    
    .move-tld {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    #clear-selected-btn,
    #select-popular-btn {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        padding: 0.2rem;
    }
    
    #select-popular-btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
        width: auto;
        height: auto;
    }
}

/* Animation for moving TLDs between lists */
@keyframes moveToSelected {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(20px);
        opacity: 0.5;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes moveToAvailable {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-20px);
        opacity: 0.5;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.tld-item.moving-to-selected {
    animation: moveToSelected 0.5s ease-in-out;
}

.tld-item.moving-to-available {
    animation: moveToAvailable 0.5s ease-in-out;
}

/* Counter styles */
#selected-count,
#available-count {
    font-weight: 600;
    color: inherit;
}

/* Results page styles */
/* Compact table layout for domain results */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

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

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
    padding: 1rem;
}

/* Extension badges in compact view */
.extension-badge {
    margin: 2px;
    font-size: 0.8rem;
}

.extension-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.extension-item:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .extension-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
    }
    
    .extension-item .d-flex {
        width: 100%;
        justify-content: space-between;
    }
}

/* Print optimizations */
@media print {
    .table {
        font-size: 0.8rem;
    }
    
    .extension-item {
        margin-bottom: 4px;
    }
}

/* Unavailable domains styling */
.unavailable-tld-grid .badge {
    font-size: 0.7rem;
}

.stat-item {
    text-align: center;
    padding: 10px;
}

.stat-item i {
    opacity: 0.8;
}

.stat-item h5 {
    font-weight: bold;
    color: #333;
}

.border-danger.border-opacity-25 {
    border-color: rgba(220, 53, 69, 0.25) !important;
}

.bg-danger.bg-opacity-25 {
    background-color: rgba(220, 53, 69, 0.25) !important;
}

.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Toast notification styles */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}
