/**
 * Domify Styles - Optimized
 * ver 2.1
 */

/* ===== BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #061f8e 0%, #01272b 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ===== GLASS EFFECTS ===== */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== CONTAINERS ===== */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 40px;
}

.login-container {
    max-width: 400px;
    margin: 0 auto;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

input,
select,
textarea,
#createUserForm .form-group input,
#createUserForm .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

input:focus,
select:focus,
textarea:focus,
#createUserForm .form-group input:focus,
#createUserForm .form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Select styling */
select#parent_domain option {
    background: #2c445ade;
    color: #fff;
}

select#parent_domain option:hover,
select#parent_domain option:checked {
    background-color: #2c445ade;
    color: #fff;
}

select#parent_domain:focus {
    outline: none;
    border-color: #2c445ade;
}

/* ===== BUTTONS ===== */
button,
.btn-primary,
.btn-secondary {
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: rgba(76, 175, 80, 0.9) !important;
    box-shadow: 0 12px 40px rgba(76, 175, 80, 0.3) !important;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2) !important;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #888);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

/* Copy buttons */
.copy-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    width: auto;
    transition: all 0.3s ease;
}

.copy-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.copy-all-button {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
}

/* ===== NAVIGATION ===== */
.nav {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===== STATS & CARDS ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 8px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.card {
    padding: 30px;
    margin-bottom: 20px;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

td {
    color: rgba(255, 255, 255, 0.8);
}

table th:first-child,
table td:first-child {
    width: 60px;
}

table th:last-child,
table td:last-child {
    width: 120px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.badge-error {
    background: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.badge-info {
    background: rgba(33, 150, 243, 0.3);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.4);
}

.badge-warning {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.4);
    color: #FF9800;
}

/* Domain type badges */
.domain-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.domain-type-badge.subdomain-added {
    background: rgba(103, 58, 183, 0.2);
    color: #AE93DF;
    border: 1px solid rgba(103, 58, 183, 0.3);
}

.domain-type-badge.new-subscription {
    background: rgba(33, 150, 243, 0.2);
    color: #93D8DF;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* ===== ALERTS ===== */
.alert,
.alert-success,
.alert-error,
.alert-info {
    padding: 20px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid;
    position: relative;
    backdrop-filter: blur(10px);
    animation: slideInDown 0.3s ease;
}

.alert-success {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4CAF50;
    color: #EBECEB;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.alert-success h4 {
    color: #F0F1F2;
    margin-bottom: 15px;
    font-size: 18px;
}

.alert-error {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    color: #C62828;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.alert-info {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196F3;
    color: #fff;
}

/* Alert details */
.success-detail,
.error-detail {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.success-detail {
    background: rgba(76, 175, 80, 0.15);
    border-left: 4px solid #4CAF50;
    color: #EBECEB;
}

.error-detail {
    background: rgba(244, 67, 54, 0.15);
    border-left: 4px solid #f44336;
    color: #C62828;
}

.success-detail strong,
.error-detail strong {
    font-weight: 600;
}

.success-detail a {
    color: #68FF00;
    text-decoration: none;
    font-weight: 500;
}

.success-detail a:hover {
    text-decoration: underline;
}

/* Form info */
.form-info {
    margin-top: 8px;
}

.info-message {
    padding: 12px;
    border-radius: 8px;
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    backdrop-filter: blur(10px);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.connection-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

/* Modal content */
.modal-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    animation: slideInUp 0.4s ease-out;
    color: #ffffff;
}

#createUserModal .modal-content {
    animation: modalFadeIn 0.3s ease;
    max-width: 500px;
    margin: auto;
}

.modal-content .container {
    padding: 40px;
    position: relative;
}

/* Connection modal specific */
.connection-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #333;
}

.connection-modal-content h2 {
    color: black;
}

/* Modal close buttons */
.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 300;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.close-connection-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    background: #f44336;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal titles */
.modal-content h2 {
    color: #ffffff !important;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== CONNECTION DATA ===== */
#connectionData {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 10px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.9);
    max-height: 400px;
    overflow-y: auto;
    position: relative;
    margin: 20px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#connectionData .data-title {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#connectionData .data-line {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-line a {
    color: #fff;
}

/* Connection sections */
.connection-section {
    margin-bottom: 20px;
}

.connection-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.connection-label {
    font-weight: 600;
    min-width: 60px;
    color: #555;
}

.connection-value {
    flex: 1;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.7);
    padding: 5px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.connection-text-block {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: monospace;
    white-space: pre-line;
    font-size: 12px;
    border: 1px solid #ddd;
    max-height: 300px;
    overflow-y: auto;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .nav {
        flex-direction: column;
        gap: 10px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 8px;
    }

    .connection-modal-content {
        padding: 20px;
        width: 95%;
    }
}

.logout-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.logout-overlay.show {
    display: flex;
}

.logout-modal {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    animation: modalPop 0.3s ease;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/*
.connection-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.connection-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #333;
}

.close-connection-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(244, 67, 54, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 300;
    line-height: 1;
}

.close-connection-modal:hover {
    background: rgba(244, 67, 54, 1);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.connection-modal-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
}

.connection-section {
    margin-bottom: 20px;
}

.connection-section h3 {
    color: #555;
    margin-bottom: 10px;
    font-size: 16px;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.connection-label {
    font-weight: 600;
    min-width: 60px;
    color: #666;
}

.connection-value {
    flex: 1;
    color: #333;
    word-break: break-all;
}

.copy-button {
    background: rgba(33, 150, 243, 0.9);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: rgba(33, 150, 243, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
}

.connection-text-block {
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-line;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    color: #333;
    line-height: 1.8;
}

.copy-all-button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

.copy-all-button:active {
    transform: translateY(0);
}
*/
/* Responsive */
@media (max-width: 768px) {
    .connection-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .close-connection-modal {
        right: 10px;
        top: 10px;
        width: 36px;
        height: 36px;
    }
}

.connection-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.connection-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #333;
}

.close-connection-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(244, 67, 54, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 300;
    line-height: 1;
}

.close-connection-modal:hover {
    background: rgba(244, 67, 54, 1);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.connection-modal-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
}

.connection-section {
    margin-bottom: 20px;
}

.connection-section h3 {
    color: #555;
    margin-bottom: 10px;
    font-size: 16px;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.connection-label {
    font-weight: 600;
    min-width: 60px;
    color: #666;
}

.connection-value {
    flex: 1;
    color: #333;
    word-break: break-all;
}

.copy-button {
    background: rgba(33, 150, 243, 0.9);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: rgba(33, 150, 243, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
}

.connection-text-block {
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-line;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    color: #333;
    line-height: 1.8;
}

.copy-all-button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

.copy-all-button:active {
    transform: translateY(0);
}

button[onclick*="closeConnectionModal"] {
    transition: all 0.3s ease;
}

button[onclick*="closeConnectionModal"]:hover {
    background: rgba(33, 150, 243, 1) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4) !important;
}

button[onclick*="closeConnectionModal"]:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .connection-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .close-connection-modal {
        right: 10px;
        top: 10px;
        width: 36px;
        height: 36px;
    }
}