* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            overflow-x: hidden;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }

        .header {
            text-align: center;
            margin-bottom: 40px;
            animation: fadeInDown 0.8s ease-out;
        }

        .header h1 {
            font-size: 3rem;
            font-weight: 800;
            background: linear-gradient(45deg, #fff, #f8f9ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 10px;
            text-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }

        .header p {
            color: rgba(255,255,255,0.9);
            font-size: 1.2rem;
            font-weight: 300;
        }

        .controls {
            display: flex;
            flex-wrap: wrap;
            justify-content: center; /* Center align flex items */
            gap: 20px;
            margin-bottom: 40px;
            animation: fadeInUp 0.8s ease-out 0.2s both;
        }

        .control-group {
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 20px;
            padding: 25px;
            transition: all 0.3s ease;
        }

        .control-group:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.2);
            background: rgba(255,255,255,0.25);
        }

        .control-group h3 {
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .control-group select {
            width: 100%;
            padding: 12px 15px;
            border: none;
            border-radius: 12px;
            background: rgba(255,255,255,0.9);
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .control-group select:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
            transform: scale(1.02);
        }

        .generate-btn {
            background: linear-gradient(45deg, #ff6b6b, #ffa500);
            border: none;
            border-radius: 15px;
            padding: 18px 40px;
            color: white;
            font-size: 1.2rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            position: relative;
            overflow: hidden;
            width: 100%; /* Ensure it takes full width within its flex context */
            max-width: 400px; /* Limit its max width for better aesthetics */
        }

        .generate-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 30px rgba(255,107,107,0.4);
        }

        .generate-btn:active {
            transform: scale(0.98);
        }

        .generate-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s;
        }

        .generate-btn:hover::before {
            left: 100%;
        }

        .palette-container {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 25px;
            padding: 30px;
            margin-bottom: 40px;
            animation: fadeInUp 0.8s ease-out 0.4s both;
        }

        .palette-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 20px;
            margin-bottom: 25px;
        }

        .color-card {
            aspect-ratio: 1;
            border-radius: 20px;
            position: relative;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }

        .color-card:hover {
            transform: scale(1.05) rotate(2deg);
            box-shadow: 0 20px 50px rgba(0,0,0,0.3);
        }

        .color-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .color-card:hover::before {
            opacity: 1;
        }

        .color-info {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(transparent, rgba(0,0,0,0.8));
            color: white;
            padding: 15px;
            transform: translateY(100%);
            transition: transform 0.3s ease;
        }

        .color-card:hover .color-info {
            transform: translateY(0);
        }

        .color-hex {
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 5px;
        }

        .color-name {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .copy-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(255,255,255,0.2);
            border: none;
            border-radius: 8px;
            padding: 8px;
            color: white;
            cursor: pointer;
            opacity: 0;
            transform: scale(0.8);
            transition: all 0.3s ease;
        }

        .color-card:hover .copy-btn {
            opacity: 1;
            transform: scale(1);
        }

        .copy-btn:hover {
            background: rgba(255,255,255,0.3);
            transform: scale(1.1);
        }

        .palette-actions {
            display: flex;
            gap: 15px;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 25px; /* Added margin-bottom */
        }

        .palette-description {
            color: rgba(255,255,255,0.9);
            font-size: 1rem;
            line-height: 1.6;
            text-align: center;
            margin-top: 20px;
            padding: 0 20px;
        }

        .palette-description strong {
            color: white;
        }

        .action-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            border-radius: 12px;
            padding: 12px 20px;
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .action-btn:hover {
            background: rgba(255,255,255,0.3);
            transform: translateY(-2px);
        }

        .saved-palettes {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 25px;
            padding: 30px;
            animation: fadeInUp 0.8s ease-out 0.6s both;
        }

        .saved-palettes h2 {
            color: white;
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 20px;
            text-align: center;
        }

        .saved-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
        }

        .saved-palette {
            background: rgba(255,255,255,0.15);
            border-radius: 15px;
            padding: 20px;
            transition: all 0.3s ease;
            position: relative; /* Added for positioning the delete button */
        }

        .saved-palette:hover {
            transform: translateY(-5px);
            background: rgba(255,255,255,0.25);
        }

        .delete-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(255, 0, 0, 0.6);
            color: white;
            border: none;
            border-radius: 50%;
            width: 25px;
            height: 25px;
            font-size: 0.8rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .saved-palette:hover .delete-btn {
            opacity: 1;
        }

        .delete-btn:hover {
            background: rgba(255, 0, 0, 0.8);
        }

        .saved-colors {
            display: flex;
            gap: 5px;
            margin-bottom: 10px;
        }

        .saved-color {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        .saved-color:hover {
            transform: scale(1.1);
        }

        .saved-info {
            color: rgba(255,255,255,0.9);
            font-size: 0.9rem;
            margin-bottom: 5px;
        }

        .saved-description {
            color: rgba(255,255,255,0.8);
            font-size: 0.8rem;
            line-height: 1.4;
        }

        .stats {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin: 30px 0;
            flex-wrap: wrap;
        }

        .stat {
            text-align: center;
            color: white;
        }

        .stat-number {
            font-size: 2rem;
            font-weight: 800;
            display: block;
            background: linear-gradient(45deg, #ffd700, #ffed4e);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .stat-label {
            font-size: 0.9rem;
            opacity: 0.8;
            margin-top: 5px;
        }

        .toast {
            position: fixed;
            top: 20px;
            right: 20px;
            background: linear-gradient(45deg, #4CAF50, #45a049);
            color: white;
            padding: 15px 25px;
            border-radius: 12px;
            font-weight: 600;
            transform: translateX(400px);
            transition: transform 0.3s ease;
            z-index: 1000;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }

        .toast.show {
            transform: translateX(0);
        }

        .floating-particles {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
        }

        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: rgba(255,255,255,0.6);
            border-radius: 50%;
            animation: float 6s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 1; }
            50% { transform: translateY(-20px) rotate(180deg); opacity: 0.5; }
        }

        @keyframes fadeInDown {
            from { opacity: 0; transform: translateY(-30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        .generating {
            animation: pulse 0.5s ease-in-out infinite;
        }

        @media (max-width: 768px) {
            .header h1 { font-size: 2rem; }
            .palette-grid { grid-template-columns: repeat(2, 1fr); }
            .controls { grid-template-columns: 1fr; }
            .stats { gap: 15px; }
        }

        @media (max-width: 480px) {
            .palette-grid { grid-template-columns: 1fr; }
            .saved-grid { grid-template-columns: 1fr; }
        }