:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;
    --radius: 0.5rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
}

.control-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    align-items: center;
}

input[type="color"] {
    width: 5rem;
    height: 3rem;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius);
}

.select {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    background-color: hsl(var(--primary));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.3s ease-in-out;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-4px);
}

#share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: hsl(280, 100%, 50%);
}

#share-btn:hover {
    background-color: hsl(280, 100%, 40%);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.api-status.online {
    background-color: rgba(220, 252, 231, 0.9);
    border-color: #86efac;
}

.api-status.offline {
    background-color: rgba(254, 226, 226, 0.9);
    border-color: #fca5a5;
}

.api-status.checking {
    background-color: rgba(254, 243, 199, 0.9);
    border-color: #fcd34d;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #6b7280;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0.7);
}

.status-indicator.online {
    background-color: #059669;
    animation: none;
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
}

.status-indicator.online::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #059669;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-indicator.offline {
    background-color: #dc2626;
    animation: none;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
}

.status-indicator.checking {
    background-color: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
}

.status-text {
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
}

.api-status.online .status-text {
    color: #065f46;
}

.api-status.offline .status-text {
    color: #991b1b;
}

.api-status.checking .status-text {
    color: #92400e;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.colors-container {
    flex: 1;
    margin-top: 5rem;
}

.colors {
    display: flex;
    height: calc(100vh - 5rem);
}

.color-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: flex 0.3s ease;
}

.color-block:hover {
    flex: 1.2;
}

.color-info {
    text-align: center;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.color-block:hover .color-info {
    opacity: 1;
}

.color-hex {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.color-name {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-weight: 500;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .control-wrapper {
        gap: 0.5rem;
    }

    .select, .btn {
        width: max-content;
    }

    input[type="color"] {
        width: 150px;
        height: 3rem;
    }

    .api-status {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .status-text {
        display: none;
    }

    .colors {
        flex-direction: column;
    }

    .color-block {
        height: 20vh;
    }

    .color-block:hover {
        height: 25vh;
    }
}

@media (max-width: 575px) {
    .color-block {
        min-height: 80px;
    }

    .color-block:hover {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .select, .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    .btn > svg {
        display: none;
    }

    .api-status {
        min-width: 20px;
        justify-content: center;
    }

    .status-indicator {
        width: 10px;
        height: 10px;
    }
}