/* Main Container */
.ifc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Cards */
.ifc-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 24px;
    border: 1px solid #eef2f7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ifc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Titles */
.ifc-title {
    color: #1a237e;
    font-size: 32px;
    margin: 0 0 32px 0;
    text-align: center;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Upload Area */
.ifc-upload-area {
    border: 3px dashed #5c6bc0;
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ifc-upload-area:hover {
    border-color: #3949ab;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
}

.ifc-upload-area.dragover {
    border-color: #43a047;
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { border-color: #43a047; }
    50% { border-color: #66bb6a; }
    100% { border-color: #43a047; }
}

.ifc-upload-icon {
    color: #5c6bc0;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ifc-upload-icon svg {
    stroke: currentColor;
}

.ifc-upload-text {
    font-size: 20px;
    color: #1a237e;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.ifc-upload-subtext {
    color: #666;
    margin: 0 0 25px 0;
    font-size: 16px;
    font-weight: 500;
}

.ifc-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.ifc-upload-note {
    color: #777;
    font-size: 14px;
    margin: 25px 0 0 0;
    font-weight: 500;
}

/* Preview Area */
.ifc-preview-area h3,
.ifc-card h3 {
    color: #1a237e;
    font-size: 20px;
    margin: 0 0 20px 0;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8eaf6;
}

.ifc-preview-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

@media (min-width: 768px) {
    .ifc-preview-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

.ifc-preview-image {
    max-width: 320px;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    background: #f8f9fa;
    padding: 8px;
}

.ifc-preview-info {
    flex: 1;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    min-width: 250px;
    border: 1px solid #e8eaf6;
}

.ifc-preview-info p {
    margin: 10px 0;
    color: #333;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.ifc-preview-info p:last-child {
    border-bottom: none;
}

.ifc-preview-info p span:first-child {
    color: #666;
    font-weight: 500;
}

.ifc-preview-info p span:last-child {
    color: #1a237e;
    font-weight: 600;
}

/* Format Selection */
.ifc-control-group {
    margin-bottom: 30px;
}

.ifc-label {
    display: block;
    color: #1a237e;
    font-size: 17px;
    margin-bottom: 15px;
    font-weight: 600;
}

.ifc-format-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.ifc-format-btn {
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eaf6 100%);
    border: 2px solid #c5cae9;
    border-radius: 10px;
    color: #3949ab;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 15px;
}

.ifc-format-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(57, 73, 171, 0.2);
    border-color: #3949ab;
}

.ifc-format-btn.active {
    background: linear-gradient(135deg, #3949ab 0%, #5c6bc0 100%);
    color: white;
    border-color: #3949ab;
    box-shadow: 0 5px 20px rgba(57, 73, 171, 0.3);
    transform: translateY(-3px);
}

/* Quality Slider */
.ifc-range {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #5c6bc0, #3949ab);
    border-radius: 4px;
    outline: none;
}

.ifc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: white;
    border: 3px solid #3949ab;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Buttons */
.ifc-action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

.ifc-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.ifc-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ifc-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

.ifc-btn-primary {
    background: linear-gradient(135deg, #3949ab 0%, #5c6bc0 100%);
    color: white;
}

.ifc-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #303f9f 0%, #3949ab 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(57, 73, 171, 0.3);
}

.ifc-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.ifc-btn-secondary {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    color: #555;
    border: 2px solid #e0e0e0;
}

.ifc-btn-secondary:hover {
    background: linear-gradient(135deg, #eeeeee 0%, #e0e0e0 100%);
    border-color: #bdbdbd;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ifc-btn-success {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: white;
    font-size: 17px;
    padding: 18px 36px;
}

.ifc-btn-success:hover {
    background: linear-gradient(135deg, #388e3c 0%, #43a047 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 160, 71, 0.3);
}

.ifc-download-icon {
    font-size: 22px;
    font-weight: bold;
}

/* Progress Bar */
.ifc-progress {
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ifc-progress-bar {
    height: 10px;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.ifc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5c6bc0, #3949ab, #43a047);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 5px;
}

.ifc-progress-text {
    text-align: center;
    color: #555;
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

/* Result Area */
.ifc-result-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

@media (min-width: 768px) {
    .ifc-result-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.ifc-result-preview {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    flex: 1;
}

.ifc-result-info {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    padding: 20px;
    border-radius: 12px;
    min-width: 250px;
    text-align: center;
    border: 1px solid #e8eaf6;
}

.ifc-result-info p {
    margin: 10px 0;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.ifc-result-info p:last-child {
    border-bottom: none;
}

.ifc-result-info p span:first-child {
    color: #666;
}

.ifc-result-info p span:last-child {
    color: #1a237e;
    font-weight: 600;
}

.ifc-download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Alerts */
.ifc-alert {
    background: #ffebee;
    border: 2px solid #ef5350;
    color: #c62828;
    padding: 16px 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

.ifc-alert-success {
    background: #e8f5e9;
    border-color: #66bb6a;
    color: #2e7d32;
}

/* Info Note */
.ifc-info-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 10px;
    padding: 15px 20px;
    margin-top: 30px;
    color: #1565c0;
    font-size: 14px;
    text-align: center;
}

.ifc-info-note p {
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ifc-container {
        padding: 15px;
    }
    
    .ifc-card {
        padding: 20px;
    }
    
    .ifc-title {
        font-size: 26px;
    }
    
    .ifc-upload-area {
        padding: 40px 15px;
    }
    
    .ifc-action-buttons {
        flex-direction: column;
    }
    
    .ifc-preview-image {
        max-width: 100%;
        max-height: 250px;
    }
    
    .ifc-format-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ifc-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .ifc-container {
        padding: 10px;
    }
    
    .ifc-card {
        padding: 16px;
    }
    
    .ifc-title {
        font-size: 22px;
    }
    
    .ifc-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .ifc-upload-text {
        font-size: 17px;
    }
    
    .ifc-preview-image {
        max-height: 200px;
    }
    
    .ifc-format-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ifc-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}