/**
 * Share Studio V 1.05 - Main Styles
 * A custom social media share button generator
 * Author: Dee7 Studio (https://dee7studio.com)
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #000000;
    --hover-bg: #f3f4f6;
    --code-bg: #f1f5f9;
    --shadow-light: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #262626;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border-color: #374151;
    --accent-color: #ffffff;
    --hover-bg: #2a2a2a;
    --code-bg: #1e293b;
    --shadow-light: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header styles */
header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(248, 249, 250, 0.8);
}

[data-theme="dark"] header {
    background-color: rgba(26, 26, 26, 0.8);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}

.logo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.version-badge {
    background: linear-gradient(135deg, var(--accent-color), var(--text-secondary));
    color: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Main content */
main {
    padding: 3rem 0;
}

.intro {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.intro h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Panel styles */
.config-panel, .preview-panel, .code-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.config-panel:hover, .preview-panel:hover, .code-output:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Form styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

[data-theme="dark"] select:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

/* Checkbox styles */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    background-color: var(--hover-bg);
}

.checkbox-item input[type="checkbox"] {
    width: 1em;
    height: 1em;
    accent-color: var(--accent-color);
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Preview styles */
.share-preview {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.share-button:active {
    transform: translateY(-1px);
}

.share-button-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.share-button:hover .share-button-icon {
    transform: scale(1.1);
}

/* Button display styles */
.share-button.icon-only { 
    padding: 0.75rem; 
}

.share-button.text-only {
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: var(--text-secondary);
}

.share-button.text-only:hover {
    color: var(--text-primary);
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Size variations */
.size-small .share-button { 
    padding: 0.5rem 1rem; 
    font-size: 12px; 
}

.size-small .share-button-icon { 
    width: 16px; 
    height: 16px; 
}

.size-small .share-button.icon-only { 
    padding: 0.5rem; 
}

.size-medium .share-button { 
    padding: 0.75rem 1rem; 
    font-size: 14px; 
}

.size-medium .share-button-icon { 
    width: 20px; 
    height: 20px; 
}

.size-medium .share-button.icon-only { 
    padding: 0.75rem; 
}

.size-large .share-button { 
    padding: 1rem 1.5rem; 
    font-size: 16px; 
}

.size-large .share-button-icon { 
    width: 24px; 
    height: 24px; 
}

.size-large .share-button.icon-only { 
    padding: 1rem; 
}

/* Button style variations */
.style-rounded .share-button { 
    border-radius: 8px; 
}

.style-square .share-button { 
    border-radius: 4px; 
}

.style-circle .share-button.icon-only { 
    border-radius: 50%; 
}

.style-circle .share-button:not(.icon-only) { 
    border-radius: 999px; 
}

/* Position variations */
.position-inline { 
    position: relative; 
    flex-direction: row; 
}

.position-floating-left, .position-floating-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
}

.position-floating-left { 
    left: 1.5rem; 
}

.position-floating-right { 
    right: 1.5rem; 
}

/* Code output styles */
.code-type-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.info-cdn {
    color: var(--success-color);
}

.info-standalone {
    color: var(--warning-color);
}

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    overflow-x: auto;
}

.code-block code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.copy-button:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.copy-success-message {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translate(-50%, 10px);
    background-color: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 200;
}

.copy-success-message.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* Footer styles */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
}

footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.version {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 768px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
    
    .intro h2 { 
        font-size: 2rem; 
    }
    
    .checkbox-group { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .logo h1 { 
        font-size: 1.25rem; 
    }
    
    .panel-title { 
        font-size: 1.15rem; 
    }
    
    .config-panel, .preview-panel, .code-output { 
        padding: 1.5rem; 
    }
    
    .position-floating-left { 
        left: 1rem; 
    }
    
    .position-floating-right { 
        right: 1rem; 
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .version-badge {
        order: -1;
    }
}

@media (max-width: 480px) {
    .header-left { 
        gap: 0.75rem; 
    }
    
    .logo p { 
        display: none; 
    }
    
    .checkbox-group { 
        grid-template-columns: 1fr; 
    }
    
    .share-preview {
        padding: 1.5rem;
        min-height: 150px;
    }

    .container {
        padding: 0 15px;
    }

    main {
        padding: 2rem 0;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .theme-toggle,
    .copy-button,
    .copy-success-message {
        display: none;
    }
    
    .share-preview {
        border: 1px solid #000;
    }
}
