/* API Widget Builder - Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #26ff00 0%, #e5ff00 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
}

header p {
    font-size: 1.3em;
    opacity: 0.9;
    font-weight: 300;
}

/* Widget Selector */
.widget-selector {
    background: rgb(255, 255, 255);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.widget-selector h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}

.widget-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.widget-option {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    cursor: pointer;
}

.widget-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.widget-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.widget-option h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.4em;
}

.widget-option p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Widget Container */
.widget-container {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.widget-header {
    background: linear-gradient(135deg, #1c9f48, #8de9e0);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h2 {
    margin: 0;
    font-size: 1.8em;
}

.widget-controls {
    display: flex;
    gap: 10px;
}

.widget-content {
    padding: 30px;
    min-height: 400px;
}

/* Widget Configuration */
.widget-config {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 30px;
}

.widget-config h3 {
    margin-bottom: 20px;
    color: #495057;
}

#configControls {
    margin-bottom: 20px;
}

.config-actions {
    display: flex;
    gap: 10px;
}

/* Individual Widget Styles */

/* Weather Widget */
.weather-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.weather-location {
    display: flex;
    gap: 10px;
    align-items: center;
}

.weather-location input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
}

.weather-display {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.weather-main {
    margin-bottom: 20px;
}

.weather-temp {
    font-size: 4em;
    font-weight: bold;
    margin: 20px 0;
}

.weather-description {
    font-size: 1.3em;
    text-transform: capitalize;
    opacity: 0.9;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.weather-detail {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
}

.weather-config {
    display: flex;
    gap: 20px;
}

.weather-config label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Pokemon Widget */
.pokemon-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pokemon-search {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pokemon-search input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
}

.pokemon-display {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.pokemon-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.pokemon-info h3 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-transform: capitalize;
}

.pokemon-stats {
    display: grid;
    gap: 10px;
    text-align: left;
}

.pokemon-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 6px;
}

.pokemon-images img {
    max-width: 200px;
    margin: 10px;
}

.pokemon-config {
    display: flex;
    gap: 20px;
}

.pokemon-config label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Space Widget */
.space-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.space-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.space-controls select {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}
.btn-customize {
    background: #cce50e;
    color: white;
}
.space-display {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    border-radius: 12px;
    padding: 30px;
    min-height: 300px;
}

.space-content h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #74b9ff;
}

.space-image {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    margin: 20px 0;
}

.space-description {
    line-height: 1.6;
    opacity: 0.9;
}

.space-config label {
    display: block;
    margin-bottom: 10px;
}

.space-config input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 5px;
}

/* Quotes Widget */
.quotes-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quotes-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quotes-controls select {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.quotes-display {
    background: linear-gradient(135deg, #f2ff00, #e8edc5);
    color: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quote-text {
    font-size: 1.5em;
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.4;
}

.quote-author {
    font-size: 1.1em;
    opacity: 0.8;
}

.quotes-config label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Dashboard */
.dashboard {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.dashboard-header {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-controls {
    display: flex;
    gap: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 30px;
    min-height: 200px;
}

.dashboard-widget {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
    position: relative;
}

.dashboard-widget .remove-widget {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Tutorial Section */
.tutorial-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tutorial-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.step-number {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    flex-shrink: 0;
}

.step-content h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.step-content p {
    color: #666;
    line-height: 1.5;
}

/* Code Examples */
.code-examples {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.code-examples h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}

.code-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.code-tab {
    padding: 15px 25px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.code-tab:hover {
    color: #667eea;
}

.code-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.code-panel {
    display: none;
}

.code-panel.active {
    display: block;
}

.code-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

.code-panel pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-panel code {
    font-family: inherit;
}

/* Form Elements */
input, select, textarea {
    font-family: inherit;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .widget-options {
        grid-template-columns: 1fr;
    }

    .widget-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .widget-controls {
        justify-content: center;
    }

    .weather-location,
    .pokemon-search,
    .space-controls,
    .quotes-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .pokemon-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .tutorial-steps {
        grid-template-columns: 1fr;
    }

    .code-tabs {
        flex-direction: column;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

.slide-down {
    animation: slideDown 0.3s ease;
}

/* Error States */
.error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.error h3 {
    margin-bottom: 10px;
}

.error p {
    opacity: 0.9;
}