/**
 * ConvMaster - CSS Animation Generator Styles
 * 
 * @package    ConvMaster
 * @version    1.0.0
 */

/* =====================================================
   TOOL PAGE LAYOUT
   ===================================================== */
.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-header__icon {
    font-size: 2.5rem;
}

.tool-header__icon .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.tool-header__icon .icon--css-animation {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
}

.tool-header__text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.tool-header__text p {
    margin: 0;
    color: var(--text-secondary);
}

/* =====================================================
   CSS ANIMATION GENERATOR WIDGET
   ===================================================== */
.css-animation-generator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* =====================================================
   WORKSPACE LAYOUT
   ===================================================== */
.css-animation-generator__workspace {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    padding: 1.5rem;
}

@media (max-width: 950px) {
    .css-animation-generator__workspace {
        grid-template-columns: 1fr;
    }
    
    .css-animation-generator__preview-column {
        order: -1;
    }
}

.css-animation-generator__config {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.css-animation-generator__section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.css-animation-generator__section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.css-animation-generator__step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.css-animation-generator__section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.keyframe-indicator {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* =====================================================
   ANIMATION CONTROLS
   ===================================================== */
.animation-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.animation-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.animation-control > label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.animation-control__input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.animation-control__unit {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    min-width: 30px;
}

.animation-control__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.animation-control__checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.animation-control__checkbox label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.animation-form__input {
    width: 80px;
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    text-align: center;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    -moz-appearance: textfield;
}

.animation-form__input::-webkit-outer-spin-button,
.animation-form__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.animation-form__input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.animation-form__input:focus {
    outline: none;
    border-color: var(--primary);
}

.animation-form__input--full {
    width: 100%;
    text-align: left;
    padding-left: 0.75rem;
}

.animation-form__input--small {
    width: 60px;
}

.animation-form__input--hex {
    width: 90px;
    text-transform: uppercase;
}

.animation-form__select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.animation-form__select:focus {
    outline: none;
    border-color: var(--primary);
}

.animation-form__slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-secondary);
    border-radius: 3px;
    cursor: pointer;
}

.animation-form__slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.animation-form__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.animation-form__slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.animation-form__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.animation-form__color {
    width: 50px;
    height: 36px;
    padding: 2px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.animation-form__color:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.animation-form__color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.animation-form__color::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Cubic Bezier Control */
.cubic-bezier-control {
    margin-top: -0.5rem;
}

.cubic-bezier-inputs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =====================================================
   KEYFRAMES TIMELINE
   ===================================================== */
.keyframes-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.keyframe-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.keyframe-item:hover {
    border-color: var(--primary);
}

.keyframe-item--active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.keyframe-item__percentage {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.keyframe-item__percentage input {
    width: 50px;
    padding: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    text-align: right;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    -moz-appearance: textfield;
}

.keyframe-item__percentage input::-webkit-outer-spin-button,
.keyframe-item__percentage input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.keyframe-item__percentage span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.keyframe-item__preview {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keyframe-item__remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.keyframe-item__remove:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.keyframe-item__remove svg {
    width: 16px;
    height: 16px;
}

/* Add Keyframe Button */
.btn--add-keyframe {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    background: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
}

.btn--add-keyframe:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* =====================================================
   KEYFRAME EDITOR
   ===================================================== */
.keyframe-editor {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.keyframe-property {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.keyframe-property > label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.keyframe-property__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.property-toggle {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* =====================================================
   PRESETS GALLERY
   ===================================================== */
.presets-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

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

/* =====================================================
   ANIMATION PREVIEW
   ===================================================== */
.animation-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    transition: background 0.3s ease;
    overflow: hidden;
}

.animation-preview__box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    min-height: 80px;
    padding: 1.5rem 2rem;
    background: #3b82f6;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: background-color 0.3s ease;
}

.preview-controls {
    display: flex;
    gap: 0.5rem;
}

.preview-options {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.preview-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-option label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* =====================================================
   CSS OUTPUT
   ===================================================== */
.css-output {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    max-height: 300px;
    overflow: auto;
}

.css-output code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.btn--copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    z-index: 1;
}

.css-animation-generator__section:has(.css-output) {
    position: relative;
}

.output-options {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--primary);
}

/* =====================================================
   ACTION BUTTONS
   ===================================================== */
.css-animation-generator__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover {
    background: var(--bg-secondary);
}

.btn--outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn--outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.btn--icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
}

.btn--icon:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn svg {
    flex-shrink: 0;
}

/* Privacy Info */
.animation-preview__info {
    text-align: center;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.animation-preview__info p {
    font-size: 0.8rem;
    color: var(--success);
    margin: 0;
}

/* =====================================================
   SEO CONTENT
   ===================================================== */
.tool-content {
    margin-top: 3rem;
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Syntax Card */
.syntax-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.syntax-card code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    line-height: 1.8;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.step-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p {
    padding: 0 1.5rem 1rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =====================================================
   HIDDEN ELEMENTS
   ===================================================== */
[hidden] {
    display: none !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
    .css-animation-generator__workspace {
        padding: 1rem;
    }
    
    .preview-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .keyframe-property__row {
        flex-wrap: wrap;
    }
    
    .cubic-bezier-inputs {
        flex-wrap: wrap;
    }
    
    .presets-gallery {
        max-height: 120px;
        overflow-y: auto;
    }
}

/* =====================================================
   LIGHT THEME ADJUSTMENTS
   ===================================================== */
[data-theme="light"] .animation-form__input,
[data-theme="light"] .animation-form__color,
[data-theme="light"] .animation-form__select {
    background: var(--bg-primary);
}

[data-theme="light"] .css-animation-generator__section {
    background: var(--bg-secondary);
}

[data-theme="light"] .animation-preview {
    background: #f1f5f9;
}

[data-theme="light"] .css-output {
    background: #f8fafc;
}

[data-theme="light"] .keyframe-item {
    background: var(--bg-primary);
}

/* Code syntax highlighting */
.css-output code {
    color: var(--text-primary);
}

/* =====================================================
   COPY NOTIFICATION
   ===================================================== */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.copy-notification--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-notification--error {
    background: var(--error);
}

/* =====================================================
   INLINE MESSAGES
   ===================================================== */
.inline-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.inline-message--error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.inline-message--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.inline-message--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
