* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(-10px) rotate(-1deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: containerFadeIn 1s ease-out;
}

@keyframes containerFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease-in-out infinite;
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerFloat 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes headerFloat {
    0%, 100% { transform: rotate(0deg) translate(-20px, -20px); }
    50% { transform: rotate(180deg) translate(20px, 20px); }
}

.header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2);
    font-weight: 700;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.header p {
    font-size: 1.2em;
    opacity: 0.95;
    font-weight: 300;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes titleGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.2); }
    to { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.4); }
}

.controls {
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-bottom: 1px solid rgba(233, 236, 239, 0.3);
    backdrop-filter: blur(5px);
    position: relative;
}

.controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.control-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.strategy-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.strategy-explanation {
    width: 100%;
    max-width: 600px;
    margin-top: 10px;
}

.strategy-description {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 5px 20px rgba(102, 126, 234, 0.1);
    animation: fadeInUp 0.5s ease forwards;
    position: relative;
    overflow: hidden;
}

.strategy-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.strategy-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.2);
    animation: iconPulse 2s ease-in-out infinite;
}

.strategy-text {
    flex: 1;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.strategy-text strong {
    color: #667eea;
    font-weight: 700;
    font-size: 15px;
}

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

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

label {
    font-weight: 600;
    color: #495057;
    font-size: 1.1em;
}

input[type="number"] {
    width: 120px;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: gradientShift 3s ease-in-out infinite;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-position: 100% 50%;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.xml-upload {
    margin-top: 20px;
    text-align: center;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 12px 25px;
    background: #28a745;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    background: #218838;
    transform: translateY(-2px);
}

.result-area {
    padding: 30px;
    min-height: 400px;
}

.combination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.6) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.combination-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.element {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 50%, #4CAF50 100%);
    background-size: 200% 200%;
    color: white;
    padding: 20px 30px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 
        0 10px 30px rgba(76, 175, 80, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.element::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: elementFloat 10s ease-in-out infinite;
}

.element:hover {
    transform: translateY(-8px) scale(1.08);
    box-shadow: 
        0 20px 40px rgba(76, 175, 80, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-position: 100% 50%;
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes elementFloat {
    0%, 100% { transform: rotate(0deg) translate(0, 0); }
    50% { transform: rotate(180deg) translate(10px, -10px); }
}

.element-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.element-category {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 5px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.arrow {
    font-size: 28px;
    color: #667eea;
    font-weight: bold;
    animation: arrowPulse 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.2));
    transition: all 0.3s ease;
}

.arrow:hover {
    transform: scale(1.2);
    color: #764ba2;
    text-shadow: 0 0 20px rgba(118, 75, 162, 0.5);
}

@keyframes arrowPulse {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #6c757d;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.elements-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #1565c0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
        margin: 0;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2.2em;
        margin-bottom: 12px;
    }
    
    .header p {
        font-size: 1.1em;
    }
    
    .controls {
        padding: 25px 20px;
    }
    
    .control-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .strategy-group {
        flex-direction: column;
    }
    
    .input-group {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    select {
        min-width: 100%;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 14px;
        width: 100%;
        max-width: 280px;
    }
    
    .result-area {
        padding: 20px 15px;
    }
    
    .combination-container {
        flex-direction: column;
        gap: 20px;
        padding: 25px 15px;
        margin: 20px 0;
    }
    
    .element {
        width: 100%;
        max-width: 280px;
        padding: 18px 25px;
    }
    
    .element-name {
        font-size: 16px;
    }
    
    .arrow {
        transform: rotate(90deg);
        font-size: 24px;
    }
    
    .arrow:hover {
        transform: rotate(90deg) scale(1.2);
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .element {
        padding: 15px 20px;
    }
    
    .combination-container {
        padding: 20px 10px;
    }
}