/* Font Loading Optimization - fonts loaded via Google Fonts in HTML head */

/* CSS Custom Properties for better maintainability */
        :root {
            --color-chatgpt: #74AA9C;
            --color-claude: #CC785C;
            --color-copilot: #40a6ff;
            --color-success: #10b981;
            --color-error: #ef4444;
            --color-warning: #f59e0b;
            --gradient-primary: linear-gradient(180deg, #000000 0%, #1B365D 100%);
            --gradient-header: linear-gradient(180deg, #1B365D 0%, #1B365D 20%, #0033A0 80%, #0033A0 100%);
            --gradient-button: linear-gradient(180deg, #0033A0 0%, #0033A0 30%, #1B365D 70%, #1B365D 100%);
            --shadow-card: 0 20px 40px rgba(0,0,0,0.1);
            --shadow-button: 0 10px 20px rgba(30, 138, 255, 0.3);
            --border-radius-lg: 16px;
            --border-radius-md: 12px;
            --border-radius-sm: 8px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
            background: var(--gradient-primary);
            min-height: 100vh;
            padding: 20px;
            color: #333;
            font-size: 16px;
            line-height: 1.5;
        }

        .container {
            max-width: 900px;
            margin: 0 auto;
            background: white;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-card);
            overflow: hidden;
        }

        .header {
            background: var(--gradient-header);
            color: white;
            padding: 30px;
            text-align: center;
        }

        .header h1 {
            font-family: 'Jersey 15', 'Arial Black', Impact, 'Franklin Gothic Bold', sans-serif;
            font-size: 2.5em;
            margin-bottom: 10px;
            font-weight: 400;
        }

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

        .main {
            padding: 40px;
        }

        /* IMPROVED: Alert system for user feedback */
        .alert {
            padding: 12px 16px;
            border-radius: var(--border-radius-sm);
            margin-bottom: 20px;
            font-weight: 500;
            display: none;
            animation: slideIn 0.3s ease-out;
        }

        .alert.show {
            display: block;
        }

        .alert.slide-out {
            animation: slideOut 0.3s ease-in forwards;
        }

        .alert.success {
            background: #dcfce7;
            color: #166534;
            border: 1px solid #bbf7d0;
        }

        .alert.error {
            background: #fef2f2;
            color: #dc2626;
            border: 1px solid #fecaca;
        }

        .alert.warning {
            background: #fffbeb;
            color: #d97706;
            border: 1px solid #fed7aa;
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .platform-selector {
            margin-bottom: 30px;
        }

        .platform-selector-header {
            text-align: center;
            font-family: 'Jersey 15', 'Arial Black', Impact, 'Franklin Gothic Bold', sans-serif;
            font-weight: 400;
            color: #000000;
            margin-bottom: 15px;
            font-size: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .platform-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            role: tablist;
        }

        /* IMPROVED: Consolidated platform button styles using CSS custom properties */
        .platform-btn {
            flex: 1;
            max-width: 180px;
            padding: 15px 20px;
            border: 2px solid #e5e7eb;
            background: white;
            border-radius: var(--border-radius-md);
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            font-weight: 600;
            font-size: 1.1rem;
            color: #374151;
            position: relative;
        }

        .platform-btn:hover {
            transform: translateY(-1px);
        }

        .platform-btn:focus {
            outline: 2px solid #1E8AFF;
            outline-offset: 2px;
        }

        /* Platform-specific colors */
        .platform-btn[data-platform="chatgpt"] { --platform-color: var(--color-chatgpt); }
        .platform-btn[data-platform="claude"] { --platform-color: var(--color-claude); }
        .platform-btn[data-platform="copilot"] { --platform-color: var(--color-copilot); }

        .platform-btn:hover:not(.active) {
            background: color-mix(in srgb, var(--platform-color) 10%, white);
            color: var(--platform-color);
            border-color: var(--platform-color);
        }

        .platform-btn.active {
            border-color: var(--platform-color);
            background: var(--platform-color);
            color: white;
        }

        .input-section {
            margin-bottom: 30px;
        }

        .input-section label {
            display: block;
            margin-bottom: 10px;
            font-family: 'Jersey 15', 'Arial Black', Impact, 'Franklin Gothic Bold', sans-serif;
            font-weight: 400;
            color: #374151;
            font-size: 1.2rem;
            text-align: center;
        }

        .input-textarea {
            width: 100%;
            min-height: 150px;
            padding: 20px;
            border: 2px solid #e5e7eb;
            border-radius: var(--border-radius-md);
            font-size: 1rem;
            font-family: 'Roboto', sans-serif;
            resize: vertical;
            transition: all 0.3s ease;
            line-height: 1.5;
        }

        .input-textarea:focus {
            outline: none;
            border-color: #1E8AFF;
            box-shadow: 0 0 0 3px rgba(30, 138, 255, 0.1);
        }

        .input-textarea.error {
            border-color: var(--color-error);
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
        }

        /* Character counter */
        .input-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 8px;
            font-size: 0.875rem;
            color: #6b7280;
        }

        .char-counter {
            font-size: 0.875rem;
            color: #6b7280;
        }

        .char-counter.warning {
            color: var(--color-warning);
        }

        .char-counter.error {
            color: var(--color-error);
        }

        .generate-btn {
            width: 100%;
            padding: 18px;
            background: var(--gradient-button);
            color: white;
            border: none;
            border-radius: var(--border-radius-md);
            font-size: 1.2rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 30px;
            position: relative;
        }

        .generate-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: var(--shadow-button);
        }

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

        .generate-btn.success {
            background: linear-gradient(45deg, var(--color-success), #059669);
            transform: scale(1.02);
        }

        .output-section {
            display: none;
        }

        .output-section.visible {
            display: block;
            animation: fadeIn 0.5s ease-in;
        }

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

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

        .output-label {
            font-family: 'Jersey 15', 'Arial Black', Impact, 'Franklin Gothic Bold', sans-serif;
            font-weight: 400;
            color: #374151;
            font-size: 1.2rem;
        }

        .copy-btn {
            padding: 10px 20px;
            background: #6b7280;
            color: white;
            border: none;
            border-radius: var(--border-radius-sm);
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .copy-btn:hover:not(.copied) {
            background: #4b5563;
            transform: translateY(-1px);
        }

        .copy-btn.copied {
            background: var(--color-success);
            transform: scale(1.05);
        }

        .output-textarea {
            width: 100%;
            min-height: 350px;
            padding: 20px;
            border: 2px solid #e5e7eb;
            border-radius: var(--border-radius-md);
            font-size: 0.9rem;
            font-family: 'Roboto', sans-serif;
            background: #f8fafc;
            resize: vertical;
            line-height: 1.6;
            transition: border-color 0.3s ease;
        }

        .output-textarea:focus {
            outline: none;
            border-color: var(--color-success);
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: #6b7280;
            font-size: 1rem;
            display: none;
        }

        .loading.show {
            display: block;
        }

        .spinner {
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 3px solid #f3f4f6;
            border-top: 3px solid #1E8AFF;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 10px;
        }

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

        .improvements-badge {
            display: inline-block;
            padding: 6px 12px;
            background: linear-gradient(45deg, #059669, #047857);
            color: white;
            border-radius: 16px;
            font-size: 0.8rem;
            font-weight: 600;
            margin-bottom: 15px;
            box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
        }

        /* IMPROVED: Better responsive design */
        @media (max-width: 768px) {
            body {
                font-size: 16px;
                padding: 10px;
            }

            .container {
                margin: 10px;
                border-radius: var(--border-radius-md);
            }

            .header {
                padding: 20px;
            }

            .header h1 {
                font-size: 2rem;
            }

            .header p {
                font-size: 1rem;
            }

            .main {
                padding: 20px;
            }

            .platform-buttons {
                flex-direction: column;
            }

            .platform-btn {
                max-width: none;
                font-size: 1rem;
            }

            .input-section label {
                font-size: 1rem;
            }

            .input-textarea {
                font-size: 16px;
                min-height: 120px;
            }

            .generate-btn {
                font-size: 1.1rem;
            }

            .output-header {
                flex-direction: column;
                gap: 10px;
                align-items: stretch;
            }

            .output-textarea {
                font-size: 14px;
                min-height: 250px;
            }
        }

        @media (min-width: 769px) {
            body {
                font-size: 18px;
            }

            .header h1 {
                font-size: 2.5rem;
            }

            .header p {
                font-size: 1.2rem;
            }
        }

/* Added from recommendations */
@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .alert { animation: none !important; }
  .generate-btn:hover { transform: none !important; box-shadow: none !important; }
  .copy-btn:hover { transform: none !important; }
}
