/* Main styles for Domains Manager */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Table styles */
.table {
    table-layout: fixed;
    width: 100%;
}

.table th {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    height: 50px; /* Fixed height for all rows */
    max-height: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Domain name column width */
.table th:first-child,
.table td:first-child {
    width: 20%; /* Adjust based on your needs */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions column width */
.table th:last-child,
.table td:last-child {
    width: 200px; /* Fixed width for action buttons */
    text-align: center;
}

.view-container {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Button styles */
.action-btn {
    cursor: pointer;
    margin: 0 2px;
    width: 70px; /* Fixed width for buttons */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.2rem;
}

.btn-group {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

/* Inline edit icon */
.edit-icon {
    cursor: pointer;
    margin-left: 8px;
    color: #6c757d;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.edit-icon:hover {
    opacity: 1;
    color: #0d6efd;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #198754;
}

input:focus + .slider {
    box-shadow: 0 0 1px #198754;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Add hover effect to table rows */
.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.badge-autorenew {
    font-size: 0.8rem;
    padding: 0.4rem;
    width: 40px;
    display: inline-block;
    text-align: center;
}

.expiry-warning {
    color: #dc3545;
    font-weight: bold;
}

.expiry-upcoming {
    color: #fd7e14;
    font-weight: bold;
}

/* Highlight row based on expiry status */
tr.expired-domain {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

tr.expired-domain:hover {
    background-color: rgba(220, 53, 69, 0.25) !important;
}

tr.expiring-soon-domain {
    background-color: rgba(253, 126, 20, 0.15) !important;
}

tr.expiring-soon-domain:hover {
    background-color: rgba(253, 126, 20, 0.25) !important;
}

/* Badge with consistent height for expiry status to maintain consistent row height */
.expiry-badge {
    width: 60px;
    display: inline-block;
    text-align: center;
    padding: 3px 4px;
    font-size: 0.75rem;
    vertical-align: middle;
}

/* Visual separation for filter section */
.filter-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Additional space between filters and table */
.table-section {
    margin-top: 25px;
}

/* Consistent data cell height */
.table td {
    height: 58px !important;
    max-height: 58px !important;
    vertical-align: middle;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}
 
::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sortable table styles */
th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px; /* Space for sort icon */
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

th.sortable::after {
    content: "⇕"; /* Unicode sort icon */
    position: absolute;
    right: 8px;
    color: #6c757d;
    opacity: 0.5;
    font-size: 0.8rem;
}

th.sortable.asc::after {
    content: "↑"; /* Unicode sort-up icon */
    opacity: 1;
    color: #0d6efd;
}

th.sortable.desc::after {
    content: "↓"; /* Unicode sort-down icon */
    opacity: 1;
    color: #0d6efd;
}

/* Pagination styles */
.pagination {
    margin-bottom: 0;
}

/* Filter form styles */
.filter-form .form-control,
.filter-form .form-select {
    font-size: 0.875rem;
}

/* Table control styling */
.table-controls {
    margin-bottom: 15px;
}

.table-controls .form-control {
    max-width: 300px;
}

/* Search input styling */
.search-input {
    position: relative;
}

.search-input .form-control {
    padding-left: 30px;
}

.search-input::before {
    content: "🔍";
    position: absolute;
    left: 8px;
    top: 6px;
    color: #6c757d;
    opacity: 0.5;
}