/* iFoundry Custom Styles */

:root {
    --primary: #d5271a;
    --primary-dark: #b01f13;
    --primary-light: #e84a3e;
    --accent: #7a7e81;
    --accent-light: #9ba0a3;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(213, 39, 26, 0.3);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background-color: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #5a5e61;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* Step Indicator Styles */
.step-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.step-circle.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(213, 39, 26, 0.2);
}

.step-circle.completed {
    background-color: #10b981;
    color: white;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.step-line {
    transition: all 0.3s ease;
}

.step-line.completed {
    background-color: #10b981;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.step-content.active {
    display: block;
}

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

/* File Card Styles */
.file-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.file-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.file-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.file-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.file-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Table Preview Styles */
.table-preview {
    overflow-x: auto;
    margin-top: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.table-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-preview th {
    background-color: #f9fafb;
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.table-preview td {
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
}

/* Configuration Card */
.config-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.config-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-card-body {
    padding: 1.5rem;
}

.config-section {
    margin-bottom: 1.5rem;
}

.config-section-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* Form Input Styles */
.form-input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213, 39, 26, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213, 39, 26, 0.1);
}

/* Column Row */
.column-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    margin-bottom: 0.5rem;
}

.column-row:hover {
    background-color: #f3f4f6;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-fact {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-dimension {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-ai {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

/* Relationship Card */
.relationship-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.relationship-card:hover {
    border-color: var(--primary);
    background-color: #fff;
}

.relationship-arrow {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 1rem;
}

/* Measure Card */
.measure-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.measure-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.measure-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.measure-dax {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
}

/* Summary Stats */
.summary-stat {
    text-align: center;
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
}

.summary-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Loading Spinner */
.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-overlay-content {
    text-align: center;
    background-color: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.spinner-large {
    width: 4rem;
    height: 4rem;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.loading-overlay-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.loading-overlay-subtext {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Drag and Drop Hover Effect */
#dropzone.drag-over {
    border-color: var(--primary);
    background-color: rgba(213, 39, 26, 0.05);
}

/* Question Box */
.question-box {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.question-box-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.question-box-title svg {
    margin-right: 0.5rem;
}

/* Collapsible Section */
.collapsible-header {
    cursor: pointer;
    user-select: none;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.expanded {
    max-height: 2000px;
}

/* Utility Classes */
.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.bg-primary {
    background-color: var(--primary);
}

.border-primary {
    border-color: var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .column-row {
        grid-template-columns: 1fr;
    }

    .relationship-card {
        flex-direction: column;
        text-align: center;
    }

    .relationship-arrow {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }
}
