* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #e1e5e9;
}

.container {
    background: rgba(30, 34, 45, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    color: #4fc3f7;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #b0bec5;
    font-size: 1.1em;
}

.input-section {
    margin-bottom: 30px;
}

.input-label {
    display: block;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
}

.input-container {
    position: relative;
    margin-bottom: 20px;
}

.input-box {
    width: 100%;
    padding: 20px;
    border: 2px solid #37474f;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 120px;
    background: #2a2f3a;
    color: #ffffff;
}

.input-box:focus {
    outline: none;
    border-color: #4fc3f7;
    background: #1e2328;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.input-box::placeholder {
    color: #78909c;
}

.generate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover {
    background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.3);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading {
    display: none;
    text-align: center;
    margin: 30px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(79, 195, 247, 0.2);
    border-top: 4px solid #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.output-section {
    margin-top: 40px;
    text-align: center;
}

.diagram-container {
    background: #1e2328;
    border: 2px dashed #37474f;
    border-radius: 12px;
    padding: 40px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.diagram-container.has-content {
    border-style: solid;
    border-color: #4fc3f7;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.placeholder-text {
    color: #78909c;
    font-size: 1.1em;
    font-weight: 500;
}

#sldDiagram {
    max-width: 100%;
    height: auto;
}

.download-btn {
    background: #66bb6a;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.download-btn:hover {
    background: #4caf50;
    transform: translateY(-1px);
}

.examples {
    background: rgba(30, 34, 45, 0.7);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.examples h3 {
    color: #ffffff;
    margin-bottom: 15px;
}

.example-item {
    background: rgba(30, 34, 45, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #4fc3f7;
    color: #e1e5e9;
}

.example-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: rgba(30, 34, 45, 1);
}

.status-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    display: none;
}

.status-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .input-box {
        padding: 15px;
        min-height: 100px;
    }
    
    .generate-btn {
        padding: 15px;
        font-size: 1em;
    }
}