/* Global Variables */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --border-color: #e9ecef;
    --text-color: #333;
    --text-light: #6c757d;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
}

/* Preloader styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
    opacity: 0;
    visibility: hidden;
}

.preloader.active {
    opacity: 1;
    visibility: visible;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid #ffffff;
    border-top: 6px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.5em;
    font-weight: bold;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Navbar Styles */
.navbar {
    box-shadow: var(--shadow);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand img {
    margin-right: 8px;
}

/* Main Content Area */
main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Container Styles */
.container-fluid {
    padding: 20px 40px;
}

/* Form Editor Styles */
.form-editor-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Header */
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.form-header h2 {
    margin: 0;
    color: var(--text-color);
    text-align: center;
    flex-grow: 1;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Navigation Buttons */
.nav-btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.nav-btn:hover {
    background-color: #357abd;
    transform: translateY(-1px);
}

.nav-btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Field Sections */
.current-fields,
.add-field-section {
    height: 100%;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

/* Field Items */
.field-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 15px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.field-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.field-item .field-name {
    flex-grow: 1;
    margin-right: 15px;
    font-weight: 500;
}

/* Buttons */
.remove-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.remove-btn:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.action-btn {
    padding: 12px;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    width: 100%;
    font-weight: 500;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* Form Elements */
.add-field-section select,
.add-field-section input {
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 100%;
    transition: var(--transition);
}

.add-field-section select:focus,
.add-field-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Labels */
.existing-field-section label,
.custom-field-section label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
}

/* Submit Button */
.submit-btn {
    padding: 14px 28px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Headings */
h3, h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
}

/* Alert Messages */
.alert {
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 15px;
    }
    
    .form-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-btn {
        width: 100%;
    }

    .col-md-8,
    .col-md-4 {
        padding: 10px;
    }

    .current-fields,
    .add-field-section {
        margin-bottom: 20px;
    }
}

/* Toast Notifications */
.toast {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.sidebar {
    border-right: 1px solid #dee2e6;
}

.sidebar-title {
    font-size: 1.2rem;
    color: #495057;
    margin-bottom: 1rem;
}

.nav-link {
    color: #495057;
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.nav-link.active {
    background-color: #007bff;
    color: white;
    border-radius: 0.25rem;
}

main {
    background-color: #fff;
    min-height: calc(100vh - 56px - 60px);
    /* Adjust for navbar and footer */
}

footer {
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Form adjustments */
.form-control,
.form-select {
    border-radius: 0.375rem;
}

.btn-primary,
.btn-success {
    border-radius: 0.375rem;
}

/* Message alerts */
.alert {
    border-radius: 0.375rem;
}

/* Technology Listing */

/* Wrapper for the listing page */
.tech-listing-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
    /* Center the cards horizontally */
}

/* Page title */
.tech-page-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-align: center;
    padding-top: 30px;
    padding-bottom: 30px;
    /* Center title */
}

/* Each card wrapper */
.tech-card-wrapper {
    display: inline-block;
}

/* Hide real radio */
.tech-radio {
    display: none;
}

/* Card style - Perfect square */
.tech-card {
    width: 160px;
    height: 160px;
    /* Make the card a square */
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: transform 0.2s, border 0.2s;
    background-size: 75%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Card hover */
.tech-card:hover {
    transform: scale(1.05);
}

/* Circle icon on top right */
.tech-radio-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: transparent;
    /* hide tick initially */
    border: 2px solid #333;
    transition: color 0.2s, border-color 0.2s;
}

/* Selected state */
.tech-radio:checked+.tech-card {
    border: 3px solid #4CAF50;
    /* green border */
}

.tech-radio:checked+.tech-card .tech-radio-overlay {
    color: #4CAF50;
    /* show green tick */
    border-color: #4CAF50;
}

/* Submit button */
.submit-btn {
    display: block;
    width: 200px;
    padding: 10px;
    margin-top: 20px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: auto;
    margin-right: auto;
}

.submit-btn:hover {
    background-color: #45a049;
}

.tech-listing-submit {
    padding-top: 100px;
}

/* Download Project Setup */

.download-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.download-btn {
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Add these new styles after the existing preloader styles */

/* Page Header */
.page-header-wrapper {
    margin-bottom: 2rem;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color), #357abd);
    padding: 2rem;
    border-radius: var(--border-radius);
    color: white;
    box-shadow: var(--shadow);
}

.header-content h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.header-content p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

/* Form Navigation */
.form-navigation {
    margin-bottom: 2rem;
}

.form-header {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.form-title {
    text-align: center;
    flex-grow: 1;
}

.form-title h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.form-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.section-header h4 i {
    color: var(--primary-color);
}

.field-count {
    background-color: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Fields Container */
.fields-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Field Items */
.field-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.field-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.field-item .field-name {
    flex-grow: 1;
    font-weight: 500;
    color: var(--text-color);
}

/* Add Field Section */
.add-field-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.add-field-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.existing-field-section,
.custom-field-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.existing-field-section label,
.custom-field-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.existing-field-section label i,
.custom-field-section label i {
    color: var(--primary-color);
}

/* Form Controls */
.form-select,
.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    outline: none;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    margin: 1rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* Buttons */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.nav-btn:hover {
    background-color: #357abd;
    transform: translateY(-1px);
}

.nav-btn i {
    font-size: 0.875rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Form Footer */
.form-footer {
    margin-top: 2rem;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-header {
        padding: 1.5rem;
    }

    .header-content h2 {
        font-size: 1.5rem;
    }

    .form-header {
        flex-direction: column;
        text-align: center;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .form-title {
        order: -1;
    }

    .fields-container {
        max-height: 400px;
    }
}

/* Custom Scrollbar for Fields Container */
.fields-container::-webkit-scrollbar {
    width: 6px;
}

.fields-container::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;
}

.fields-container::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.fields-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Technology Listing Page Styles */
.tech-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tech-page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tech-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.tech-page-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

.tech-listing-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tech-card-container {
    perspective: 1000px;
}

.tech-card-wrapper {
    display: block;
    cursor: pointer;
    position: relative;
}

.tech-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tech-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tech-card.hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tech-card-image {
    height: 200px;
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

.tech-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition);
}

.tech-radio:checked + .tech-card .tech-card-image img {
    filter: brightness(0.8);
}

.tech-radio-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.tech-radio:checked + .tech-card .tech-radio-overlay {
    opacity: 1;
}

.tech-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tech-card-content h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.tech-card-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tech-listing-submit {
    text-align: center;
    margin-top: 2rem;
}

.tech-listing-submit .submit-btn {
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.tech-listing-submit .submit-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tech-listing-submit .submit-btn i {
    font-size: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tech-page-container {
        padding: 1rem;
    }

    .tech-page-header h1 {
        font-size: 2rem;
    }

    .tech-listing-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .tech-card-image {
        height: 180px;
    }
}

/* Toast Notification Customization */
.toast-top-center {
    top: 20px;
    right: 0;
    left: 0;
    margin: 0 auto;
    max-width: 300px;
}

/* Custom styles to enhance Bootstrap */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card.border-primary {
    border-color: var(--bs-primary) !important;
}

.card input[type="radio"]:checked + .card-img-top .position-absolute {
    opacity: 1 !important;
}

.card-img-top {
    background-color: #f8f9fa;
}

/* Green custom radio circle styles */
.custom-radio-circle-green {
    width: 28px;
    height: 28px;
    border: 2.2px solid #43b649;
    border-radius: 50%;
    background: #fff;
    position: relative;
    transition: border-color 0.2s;
    font-size: 16px;
    box-sizing: border-box;
}
.custom-radio-circle-green .tick-svg {
    display: none;
}
.custom-radio-circle-green.selected .tick-svg {
    display: block;
}

/* Remove previous custom radio styles if any */
.custom-radio-circle, .custom-radio-circle .checkmark { display: none !important; }