/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700&display=swap');

/* Hide content until font is loaded */
.fonts-loading {
    visibility: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.logo-image {
    height: 150px;
    width: auto;
    object-fit: contain;
}

.logo-left {
    display: flex;
    justify-content: right;
    padding-right: 50px;
    align-items: center;
}

.logo-right {
    display: flex;
    justify-content: left;
    padding-left: 50px;
    align-items: center;
}

.arrow-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow {
    height: 50px;
    margin: 0 20px;
}

h1 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

p {
    margin-bottom: 20px;
}

.tutorial-link {
    text-decoration: none;
    font-style: italic;
}

.upload-container {
    display: flex;
    margin-bottom: 30px;
    gap: 10px;
}

input[type="file"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.drop-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    position: relative;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-area.has-file {
    border: 2px solid #3498db;
}

.drop-area-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.upload-icon {
    margin-bottom: 15px;
}

.upload-icon img {
    width: 64px;
    height: 64px;
    filter: invert(51%) sepia(98%) saturate(1844%) hue-rotate(185deg) brightness(96%) contrast(91%);
}

.drop-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #2c3e50;
}

.drop-text-small {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.browse-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
}

.browse-btn:hover {
    background-color: #2980b9;
}

.file-selected-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-name {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
    word-break: break-all;
    margin-bottom: 0px;
}

.file-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.clear-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-btn:hover {
    background-color: #c0392b;
}

.converting-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.converting-icon {
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.converting-text {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.conversion-complete-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Success Animation */
.success-animation {
    margin: 20px auto;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #27ae60;
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.check-icon::before, .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    transform: rotate(-45deg);
}

.icon-line {
    height: 5px;
    background-color: #27ae60;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(39, 174, 96, 0.3);
    animation: icon-circle 0.75s;
}

.icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: transparent;
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

@keyframes icon-circle {
    0% {
        transform: scale(0);
    }
    40% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.success-text {
    font-size: 18px;
    font-weight: 500;
    color: #27ae60;
    margin-bottom: 10px;
}

.download-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-btn:hover {
    background-color: #219653;
}

.download-icon {
    width: 20px;
    height: 20px;
    fill: white;
}

.convert-new-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}

.convert-new-btn:hover {
    background-color: #2980b9;
}

.convert-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.convert-btn:hover {
    background-color: #2980b9;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background-color: #2980b9;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

pre {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

h2 {
    margin: 20px 0 15px;
    color: #2c3e50;
}

#error {
    color: #e74c3c;
}

#errorMessage {
    background-color: #fadbd8;
    padding: 10px;
    border-radius: 4px;
}

/* Error state styles */
.error-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-animation {
    width: 100px;
    height: 100px;
    margin: 20px auto;
}

.error-icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.error-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #e74c3c;
}

.error-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(231, 76, 60, 0.3);
    animation: error-circle 0.75s;
}

.error-x-mark {
    position: relative;
    display: block;
    width: 80px;
    height: 80px;
}

.error-line {
    height: 5px;
    background-color: #e74c3c;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
    top: 37px;
    width: 47px;
}

.error-line.error-left {
    left: 17px;
    transform: rotate(45deg);
    animation: error-line-left 0.75s;
}

.error-line.error-right {
    right: 16px;
    transform: rotate(-45deg);
    animation: error-line-right 0.75s;
}

.error-text {
    font-size: 18px;
    font-weight: 500;
    color: #e74c3c;
    margin-bottom: 10px;
}

.error-message {
    font-size: 16px;
    color: #e74c3c;
    text-align: center;
    margin: 0 20px 20px;
    padding: 10px;
    background-color: #fadbd8;
    border-radius: 4px;
    max-width: 80%;
}

.try-again-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.try-again-btn:hover {
    background-color: #2980b9;
}

@keyframes error-circle {
    0% {
        transform: scale(0);
    }
    40% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes error-line-left {
    0% {
        width: 0;
        left: 40px;
    }
    40% {
        width: 0;
        left: 40px;
    }
    100% {
        width: 47px;
        left: 17px;
    }
}

@keyframes error-line-right {
    0% {
        width: 0;
        right: 40px;
    }
    40% {
        width: 0;
        right: 40px;
    }
    100% {
        width: 47px;
        right: 16px;
    }
}

/* Column Selection State */
.column-selection-state {
    text-align: center;
    padding: 40px;
}

.column-selection-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.column-selection-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

.dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 8px;
}

.dropdown-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.column-dropdown {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    transition: border-color 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.column-dropdown:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.column-dropdown:hover {
    border-color: #bdc3c7;
}

.column-dropdown.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.column-validation-error {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.column-validation-error.hidden {
    display: none;
}

.column-selection-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.back-btn {
    background-color: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    padding: 6px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.convert-btn:disabled {
    background-color: #bdc3c7;
    border-color: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
}

.convert-btn:disabled:hover {
    background-color: #bdc3c7;
    border-color: #bdc3c7;
    color: #7f8c8d;
}

/* Responsive design for column selection */
@media (max-width: 600px) {
    .dropdown-container {
        max-width: 100%;
    }
    
    .column-selection-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .back-btn,
    .convert-btn {
        width: 100%;
        justify-content: center;
    }
}
