/* === Reset & Base === */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

:root {
    --primary: #2f2f2f;
    --primary-dark: #764ba2;
    --danger: #dc3545;
    --white: #fff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-400: #ced4da;
    --gray-600: #6c757d;
    --gray-700: #495057;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--gray-700);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Navbar === */
.navbar {
    background: rgba(0, 0, 0, 0.1);
    color: var(--white);
    padding: .5rem 0;
    margin-bottom: 1rem;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-logo {
    height: 40px;
}

.navbar-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-text,
.nav-link {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.8;
}

/* === Footer === */
.footer {
    background: rgba(0, 0, 0, 0.1);
    color: var(--gray-400);
    padding: .5rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: 1rem;
}

.footer a {
    color: var(--gray-400);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--white);
}

/* === Grid & Layout === */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.col-12 {
    width: 100%;
    gap: 1rem;
    display: flex;
    flex-direction: column;
}

.d-flex {
    display: flex;
    justify-content: space-between;
}

.gap-1 {
    display: flex;
    gap: .5rem;
}

/* === Cards === */
.card {
    background: var(--white);
    border-radius: 10px;
}

.card-body {
    padding: 1rem;
}

.card-title {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.login-card {
    max-width: 500px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.95);
}

.feature-card {
    text-align: center;
    height: 100%;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
}

.feature-card h5 {
    margin: 1rem 0 0.5rem;
    font-size: 20px;
}

.feature {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: .75rem 1rem;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    width: fit-content;
    display: block;
}

.btn-primary {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-dark {
    background: #24292e;
    color: var(--white);
}

.btn-dark:hover {
    background: #1a1e22;
}

.btn-light {
    background: var(--white);
    color: var(--primary);
}

.btn-light:hover {
    background: var(--gray-100);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-400);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--gray-400);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    padding: 0.75rem;
    background: var(--gray-200);
    border: 1px solid var(--gray-400);
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    font-weight: 500;
}

.form-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* === Tables === */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
}

.table tr:hover {
    background: var(--gray-100);
}

/* === Alerts & Toasts === */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    position: relative;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.btn-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

#alerts-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 500px;
    width: 90%;
}

.alert-toast {
    pointer-events: all;
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.3s ease-out;
    margin-bottom: 0;
}

@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === Modals === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    background: var(--white);
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    overflow: hidden;
}

.modal-header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* === Utilities === */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-600);
}

.text-white {
    color: var(--white);
}

.small {
    font-size: 0.875rem;
}

.mt {
    margin-top: 1rem;
}

/* === Dashboard Styles === */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-header h2 {
    color: var(--white);
    margin: 0;
    font-weight: normal;
}

.domains-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.domain-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1rem;
}

.domain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.domain-name {
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-name:hover {
    opacity: 0.8;
}

.domain-actions {
    display: flex;
    gap: 0.5rem;
}

.domain-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-value {
    font-size: 0.9rem;
    font-family: monospace;
    background: var(--gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    height: 29px;
    overflow: auto;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-600);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--white);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
}

.empty-state h4 {
    margin: 1rem 0 0.5rem;
    opacity: 0.8;
}

.empty-state p {
    opacity: 0.6;
}

.code-block {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--gray-200);
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* === Home Page === */
.hero {
    color: var(--white);
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 1rem 0;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.maxsubdomains {
    background: var(--danger);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .feature {
        min-width: 100%;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }

    .domain-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .domain-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .domain-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}