 * {
     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%);
     min-height: 100vh;
     padding: 20px;
 }

 .container {
     max-width: 1200px;
     margin: 0 auto;
     background: rgba(255, 255, 255, 0.95);
     border-radius: 20px;
     box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
     overflow: hidden;
     backdrop-filter: blur(10px);
 }

 .header {
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     padding: 30px;
     text-align: center;
 }

 .header h1 {
     font-size: 2.5rem;
     margin-bottom: 10px;
     font-weight: 300;
 }

 .header p {
     font-size: 1.1rem;
     opacity: 0.9;
 }

 .main-content {
     padding: 40px;
 }

 .form-section {
     margin-bottom: 40px;
 }

 .form-group {
     margin-bottom: 25px;
 }

 label {
     display: block;
     margin-bottom: 8px;
     font-weight: 600;
     color: #333;
     font-size: 1.1rem;
 }

 .diagram-selector {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
     gap: 15px;
     margin-bottom: 25px;
 }

 .diagram-option {
     position: relative;
     cursor: pointer;
     transition: all 0.3s ease;
     transform: translateY(0);
 }

 .diagram-option:hover {
     transform: translateY(-5px);
 }

 .diagram-option input[type="radio"] {
     display: none;
 }

 .diagram-card {
     padding: 20px;
     border: 2px solid #e0e0e0;
     border-radius: 15px;
     background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
     text-align: center;
     transition: all 0.3s ease;
     position: relative;
     overflow: hidden;
 }

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

 .diagram-option:hover .diagram-card::before {
     left: 100%;
 }

 .diagram-option input[type="radio"]:checked+.diagram-card {
     border-color: #667eea;
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
 }

 .diagram-icon {
     font-size: 2rem;
     margin-bottom: 10px;
 }

 .diagram-title {
     font-weight: 600;
     margin-bottom: 5px;
 }

 .diagram-desc {
     font-size: 0.9rem;
     opacity: 0.8;
 }

 .input-group {
     position: relative;
 }

 textarea,
 input[type="password"] {
     width: 100%;
     padding: 15px;
     border: 2px solid #e0e0e0;
     border-radius: 10px;
     font-size: 1rem;
     transition: all 0.3s ease;
     background: #f8f9fa;
     resize: vertical;
 }

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

 .api-key-input {
     position: relative;
 }

 .api-key-toggle {
     position: absolute;
     right: 15px;
     top: 50%;
     transform: translateY(-50%);
     background: none;
     border: none;
     cursor: pointer;
     color: #666;
     font-size: 1.1rem;
 }

 .generate-btn {
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     border: none;
     padding: 15px 40px;
     border-radius: 50px;
     font-size: 1.1rem;
     font-weight: 600;
     cursor: pointer;
     transition: all 0.3s ease;
     box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
     position: relative;
     overflow: hidden;
 }

 .generate-btn:hover {
     transform: translateY(-2px);
     box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
 }

 .generate-btn:disabled {
     opacity: 0.7;
     cursor: not-allowed;
     transform: none;
 }

 .loading {
     display: none;
     text-align: center;
     margin: 20px 0;
     color: #667eea;
 }

 .spinner {
     border: 3px solid #f3f3f3;
     border-top: 3px solid #667eea;
     border-radius: 50%;
     width: 40px;
     height: 40px;
     animation: spin 1s linear infinite;
     margin: 0 auto 10px;
 }

 @keyframes spin {
     0% {
         transform: rotate(0deg);
     }

     100% {
         transform: rotate(360deg);
     }
 }

 .results-section {
     margin-top: 40px;
     padding-top: 40px;
     border-top: 2px solid #e0e0e0;
 }

 .results-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 20px;
 }

 .tabs {
     display: flex;
     gap: 10px;
     margin-bottom: 20px;
 }

 .tab {
     padding: 10px 20px;
     border: 2px solid #e0e0e0;
     border-radius: 25px;
     background: #f8f9fa;
     cursor: pointer;
     transition: all 0.3s ease;
 }

 .tab.active {
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     border-color: #667eea;
 }

 .tab-content {
     display: none;
     background: #f8f9fa;
     border-radius: 15px;
     padding: 20px;
     min-height: 400px;
 }

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

 .syntax-display {
     background: #2d3748;
     color: #e2e8f0;
     padding: 20px;
     border-radius: 10px;
     font-family: 'Courier New', monospace;
     white-space: pre-wrap;
     overflow-x: auto;
     line-height: 1.5;
 }

 .preview-container {
     background: white;
     border-radius: 10px;
     padding: 20px;
     min-height: 300px;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .copy-btn {
     background: #28a745;
     color: white;
     border: none;
     padding: 8px 15px;
     border-radius: 5px;
     cursor: pointer;
     font-size: 0.9rem;
     transition: all 0.3s ease;
 }

 .copy-btn:hover {
     background: #218838;
     transform: translateY(-1px);
 }

 .error-message {
     background: #f8d7da;
     color: #721c24;
     padding: 15px;
     border-radius: 10px;
     border: 1px solid #f5c6cb;
     margin: 15px 0;
 }

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

 @media (max-width: 768px) {
     .header h1 {
         font-size: 2rem;
     }

     .main-content {
         padding: 20px;
     }

     .diagram-selector {
         grid-template-columns: 1fr;
     }

     .results-header {
         flex-direction: column;
         gap: 15px;
         align-items: stretch;
     }

     .tabs {
         justify-content: center;
     }
 }