/* API Widget Builder - Premium Pastel Theme Refined */

:root {
    /* Pastel Palette */
    --bg-gradient: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    --pastel-blue: #e4f3f4;
    --pastel-pink: #f9ebed;
    --pastel-purple: #f1ecf8;
    --pastel-yellow: #fcf7e8;
    --pastel-green: #edf3f2;

    /* Functional Colors */
    --primary: #8e9aaf;
    --primary-light: #cbc0d3;
    --accent: #efd3d7;
    --text-main: #4a4e69;
    --text-muted: #9a8c98;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);

    /* Shadows & Effects */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 15px 45px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.12);
    --radius-lg: 32px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

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

/* Header Section */
header {
    text-align: center;
    margin-bottom: 80px;
    animation: fadeInDown 1s cubic-bezier(0.22, 1, 0.36, 1);
}

header h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -2px;
    color: var(--text-main);
    margin-bottom: 16px;
    background: linear-gradient(to right, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Widget Selector Grid */
.widget-selector {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 60px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.widget-selector h2 {
    text-align: center;
    margin-bottom: 60px;
    font-weight: 600;
    font-size: 2.4rem;
    color: var(--text-main);
}

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

.widget-option {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 40px 30px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: default;
}

.widget-option:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-light);
}

.widget-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.widget-option:hover .widget-icon {
    transform: scale(1.2) rotate(5deg);
}

.widget-option h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.widget-option p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: auto;
    min-height: 3rem;
}

.widget-option .btn {
    margin-top: 20px;
}

/* Button Refinement */
.btn {
    font-family: 'Outfit', sans-serif;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(142, 154, 175, 0.2);
}

.btn-primary:hover {
    background: var(--text-main);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 24px rgba(74, 78, 105, 0.25);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: var(--pastel-blue);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #b8dfe5;
    transform: scale(1.03);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-light);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: white;
}

.btn-danger {
    background: var(--pastel-pink);
    color: #cc444b;
}

.btn-danger:hover {
    background: #f9cbd0;
    transform: scale(1.05);
}

/* Active Widget Container */
.widget-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-heavy);
    margin-bottom: 60px;
    overflow: hidden;
    animation: containerEntry 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes containerEntry {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.widget-header {
    padding: 35px 50px;
    background: var(--pastel-purple);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.widget-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.widget-content {
    padding: 60px;
    background: white;
    min-height: 400px;
}

/* Organized Card Layout */
.organized-card {
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.row {
    display: flex;
    gap: 60px;
    align-items: center;
}

.media-col {
    flex: 0 0 450px;
}

.media-col img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-medium);
    transition: transform 0.5s ease;
}

.media-col:hover img {
    transform: scale(1.03);
}

.info-col {
    flex: 1;
}

.info-col h3 {
    font-size: 3rem;
    margin-bottom: 25px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -1px;
}

/* Dashboard Styling */
.dashboard {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.dashboard-header {
    padding: 35px 50px;
    background: var(--pastel-green);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 50px;
}

.dashboard-widget {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 30px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.dashboard-widget:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.remove-widget {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--pastel-pink);
    border: none;
    color: #cc444b;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.dashboard-widget:hover .remove-widget {
    opacity: 1;
}

.remove-widget:hover {
    background: #cc444b;
    color: white;
    transform: rotate(90deg);
}

/* Form Styling */
input,
select {
    border: 2px solid var(--pastel-blue);
    background: #fdfdfd;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(142, 154, 175, 0.1);
}



/* Animations Core */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Specialized Widget UI Fragments */
.pokemon-type {
    background: var(--pastel-purple);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 10px;
    display: inline-block;
    transition: all 0.3s ease;
}

.pokemon-type.active {
    background: var(--primary);
    color: white;
}

.weather-display {
    background: var(--pastel-blue);
    border-radius: var(--radius-md);
    padding: 50px;
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.weather-detail {
    background: var(--white);
    padding: 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.weather-detail:hover {
    transform: scale(1.05);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 80px;
    color: var(--text-muted);
    font-weight: 600;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--pastel-blue);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite cubic-bezier(0.5, 0.1, 0.4, 0.9);
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .row {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .media-col {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .widget-selector {
        padding: 30px;
    }

    .widget-header,
    .widget-content,
    .dashboard-header {
        padding: 30px;
    }
}