/* layout.css: Containers, grid, responsive, and panel structure */

/* --- MAIN CONTAINER --- */
/* Use Bootstrap's container-fluid with a custom max-width for better responsiveness */
.container.cnicadmin-main {
    margin-top: 20px;
    margin-bottom: 30px;
}

/* --- PANEL & CONTAINER LAYOUT --- */
.panel {
    margin-bottom: 25px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    background: #fff;
}

.panel-heading {
    background: linear-gradient(135deg, #1a5b98 0%, #2779bd 100%);
    padding: 22px 28px 18px;
    border-radius: 8px 8px 0 0;
    border: none;
}

.panel-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    color: #fff;
}

.panel-body {
    padding: 25px;
}

/* TLD lookup container */
.tld-lookup-container {
    max-width: 600px;
    margin: 15px auto 25px;
    padding: 0 15px;
}

.fields-container {
    background-color: #f9fbfe;
    border-radius: 8px;
    padding: 25px;
    margin: 0 -5px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Make a single field-row span full width in fields-container */
.fields-container .field-row:only-child {
    grid-column: 1 / -1;
}

/* Responsive grid adjustments */
@media (min-width: 992px) {
    .fields-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 30px;
        gap: 30px;
    }
    .field-row.field-full, 
    .field-group-header {
        grid-column: 1 / -1;
    }
    .container.cnicadmin-main {
        padding: 0 30px;
    }
}

/* Removed custom container width in favor of Bootstrap's container-fluid */

/* Loading indicator positioning */
.fields-wrapper {
    position: relative;
    min-height: 200px;
    width: 100%;
}

#loadingIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    background: rgba(255,255,255,0.9);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Additional fields section styling */
.additional-fields-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    margin-top: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e6edf3;
}

#tldFields {
  margin-bottom: 30px; /* Add bottom margin */
}

 /* Enhanced styling for recent TLDs panel */
    #recentTldsSection .panel {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border: 1px solid #e6edf5;
    }

    #recentTldsSection .panel-heading {
        background: linear-gradient(to right, #2779bd, #1a5b98);
        border-bottom: 0;
    }
    
    /* Container for recent TLD buttons */
    .recent-tlds-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 8px 0;
    }
    
    /* Staggered animation for recent TLD buttons */
    @keyframes fadeInScale {
        from {
            opacity: 0;
            transform: scale(0.92);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
    
    /* Apply animation with different delays */
    .recent-tld-btn {
        animation: fadeInScale 0.4s ease forwards;
        animation-delay: calc(var(--btn-index, 0) * 0.1s);
        opacity: 0; /* Start with opacity 0 for animation */
        position: relative;
        overflow: hidden;
    }
    
    /* Hover effect with subtle color indication */
    .recent-tld-btn:before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to right, rgba(41, 128, 185, 0.1), transparent);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 0;
    }
    
    .recent-tld-btn:hover:before {
        transform: translateX(0);
    }
    
    .recent-tld-btn .tld-text {
        position: relative;
        z-index: 1;
    }
    
    /* Panel title enhancements */
    #recentTldsSection .panel-title {
        color: white;
        font-weight: 500;
        font-size: 16px;
    }
    
    #recentTldsSection .panel-title i {
        margin-right: 5px;
    }
    
    /* Media queries for mobile */
    @media (max-width: 767px) {
        .recent-tlds-container {
            gap: 6px;
        }
        
        #recentTldsSection .panel-body {
            padding: 12px;
        }
    }