/* Hostname management styles - Reset một số style có thể bị xung đột */
.content {
    padding: 20px;
    font-size: 14px; /* Font size đồng nhất với header và footer */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Font family đồng nhất với header */
}

/* Đảm bảo tất cả text elements đều có font đồng nhất */
.content *,
.section-title,
.form-group label,
.table-responsive th,
.table-responsive td,
.pagination a,
.pagination span,
.records-info,
.empty-state,
.card-label,
.card-value,
.message,
.form-help-text,
.clear-search,
.details-btn {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px; /* Giảm padding từ 20px xuống 15px */
    margin-bottom: 20px; /* Giảm margin từ 30px xuống 20px */
}

.section-title {
    margin-top: 0;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px; /* Giảm padding từ 10px xuống 8px */
    margin-bottom: 15px; /* Giảm margin từ 20px xuống 15px */
    color: #333;
    font-size: 1.5em; /* Đồng nhất với hostname-details.css */
}

/* Message styles */
.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.credentials-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.credential-line {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credential-line strong {
    min-width: 80px;
}

.credential-line code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.credential-text {
    margin: 8px 0;
}

.success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.error {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

.form-container {
    max-width: 800px;
}

.form-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-group {
    flex: 1 1 300px;
    margin-bottom: 15px; /* Thêm margin-bottom để các group cách nhau */
}

.form-group label {
    display: block;
    margin-bottom: 5px; /* Giảm margin từ 8px xuống 5px */
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"], 
.form-group input[type="email"], 
.form-group input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    box-sizing: border-box;
    height: 38px; /* Giảm chiều cao từ 48px xuống 38px */
}

.form-group input[type="text"]:focus, 
.form-group input[type="email"]:focus, 
.form-group input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.hostname-input-group {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0;
    background: white;
    width: 100%;
    box-sizing: border-box;
    height: 38px; /* Giảm chiều cao từ 48px xuống 38px */
}

.hostname-input-group input[type="text"] {
    border: none;
    padding: 12px;
    flex: 1;
    border-radius: 8px 0 0 8px;
    outline: none;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    box-sizing: border-box;
    min-width: 120px; /* Thêm min-width cho input */
    max-width: 60%; /* Giới hạn chiều rộng tối đa */
}

.domain-separator {
    font-weight: bold;
    color: #666;
    padding: 0 8px;
    background: #f8f9fa;
    border-left: 0px solid #ddd;
    border-right: 0px solid #ddd;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.domain-select {
    border: none;
    padding: 8px 12px; /* Điều chỉnh padding */
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    outline: none;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 150px; /* Tăng min-width */
    max-width: 40%; /* Giới hạn chiều rộng tối đa */
    width: auto; /* Cho phép tự động điều chỉnh chiều rộng */
    height: 100%;
    box-sizing: border-box;
    flex: 1; /* Cho phép mở rộng để lấp đầy không gian còn lại */
}

/* Disabled domain options */
.domain-select option:disabled {
    color: #999 !important;
    font-style: italic;
    background-color: #f5f5f5;
}

.hostname-input-group:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-help-text {
    margin-top: 3px; /* Giảm margin từ 5px xuống 3px */
    font-size: 12px;
    color: #666;
}

.form-button-container {
    margin-top: 15px; /* Giảm margin từ 20px xuống 15px */
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 20px; /* Giảm padding từ 12px xuống 8px */
    border: none;
    border-radius: 6px; /* Giảm border-radius từ 8px xuống 6px */
    font-size: 14px;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-submit {
    background: linear-gradient(to right, #0062cc, #007bff);
    color: white;
    border: 1px solid rgba(0,0,0,0.05);
}

.btn-submit:hover {
    background: linear-gradient(to right, #005cbf, #0069d9);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.btn-secondary {
    background: linear-gradient(to right, #5a6268, #6c757d);
    color: white;
    border: 1px solid rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: linear-gradient(to right, #4e555b, #5a6268);
    box-shadow: 0 4px 8px rgba(108,117,125,0.3);
}

.search-container {
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.search-box input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    color: #dc3545;
}

.records-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px; /* Đồng nhất với content font size */
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table-responsive th,
.table-responsive td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px; /* Đồng nhất font size trong bảng */
    vertical-align: top; /* Căn theo đầu để tự nhiên hơn */
}

.table-responsive th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

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

.details-btn {
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2px;
    min-width: 80px;
    background: linear-gradient(to right, #4e73df, #5a8dee) !important;
    color: white !important;
}

.details-btn:before {
    margin-right: 5px;
    font-size: 12px;
    /* content: "📋"; */
}

.details-btn:hover {
    background: linear-gradient(to right, #3d5cce, #4e73df) !important;
    color: white !important;
    text-decoration: none !important;
    box-shadow: 0 4px 8px rgba(78,115,223,0.3) !important;
    transform: translateY(-1px);
}

.mobile-cards {
    display: none;
}

.pagination-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    font-size: 14px; /* Đồng nhất font size pagination */
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .disabled {
    color: #999;
    cursor: not-allowed;
}

.search-highlight {
    background: yellow;
    font-weight: bold;
}

/* Copy button styles */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 4px;
    margin-left: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
    opacity: 0.7;
}

.copy-btn:hover {
    opacity: 1;
    color: #495057;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    animation: fadeOut 1.5s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-success svg {
    width: 16px;
    height: 16px;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    70% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(10px); }
}

.field-with-copy {
    display: flex;
    align-items: center;
}

.hostname-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.hostname-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.hostname-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Status styles */
.status-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 2.5px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-offline {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-inactive {
    background-color: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.status-active .status-dot {
    background: #28a745;
}
.status-offline .status-dot {
    background: #e74c3c;
}
.status-inactive .status-dot {
    background: #adb5bd;
}
.status-pending .status-dot {
    background: #ffc107;
}

.details-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.details-link:hover {
    color: #0056b3;
}
    
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 14px; /* Đồng nhất font size */
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* IP Container Styles */
.ip-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0; /* Thêm padding nhẹ để đồng đều */
}

.ipv4-row, .ipv6-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ip-label {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    min-width: 35px;
}

.ip-value {
    font-size: 13px;
    word-break: break-all;
}

/* Mobile IP Container Styles */
.ip-container-mobile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.ipv4-row-mobile, .ipv6-row-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ip-label-mobile {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    min-width: 40px;
}

.ip-value-mobile {
    font-size: 13px;
    word-break: break-all;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .content {
        padding: 10px;
    }
    
    .section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        flex: 1 1 auto;
    }
    
    .hostname-input-group {
        flex-direction: row; /* Giữ layout ngang trên mobile */
        align-items: center;
        height: 48px; /* Giữ height cố định */
        flex-wrap: nowrap; /* Ngăn không cho wrap xuống dòng */
    }
    
    .hostname-input-group input[type="text"] {
        border-radius: 8px 0 0 8px;
        border-bottom: 0px solid #ddd; /* Khôi phục border */
        border-right: none;
        height: 100%;
        flex: 1; /* Cho phép input co giãn */
        min-width: 100px; /* Giảm min-width trên mobile */
        max-width: 50%; /* Điều chỉnh max-width trên mobile */
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    
    .domain-separator {
        height: 100%;
        padding: 0 6px; /* Giảm padding để tiết kiệm không gian */
        text-align: center;
        border-left: 0px solid #ddd;
        border-right: 0px solid #ddd;
        border-top: 0px solid #ddd;
        border-bottom: 0px solid #ddd;
        font-size: 14px; /* Giảm font size */
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    
    .domain-select {
        border-radius: 0 8px 8px 0;
        border-top: 0px solid #ddd; /* Khôi phục border */
        border-left: none;
        min-width: 130px; /* Điều chỉnh min-width trên mobile */
        max-width: 50%; /* Điều chỉnh max-width trên mobile */
        height: 100%;
        font-size: 14px; /* Giảm font size */
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        padding: 8px; /* Giảm padding */
    }
    
    .form-button-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        padding: 14px 20px; /* Slightly larger padding on mobile for better touch targets */
    }
    
    .details-btn {
        padding: 10px 16px; /* Larger padding on mobile for better touch targets */
        min-width: 90px;
        font-size: 14px; /* Slightly larger font on mobile */
        margin-bottom: 8px;
    }
    
    /* Better action buttons container in mobile cards */
    .card-actions {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
    }
    
    .table-container {
        display: none;
    }
    
    .mobile-cards {
        display: block;
    }
    
    .record-card {
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    .card-row:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .card-label {
        font-weight: 600;
        color: #333;
        font-size: 14px; /* Đồng nhất font size */
    }
    
    .card-value {
        color: #666;
        word-break: break-all;
        font-size: 14px; /* Đồng nhất font size */
    }
    
    .card-actions {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #eee;
    }
}
