/* CSS Clip-Path Maker - Modern Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-panel: #1e2139;
    --text-primary: #ffffff;
    --text-secondary: #a0a9c9;
    --border-color: #2a2f4c;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.6s ease;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    animation: fadeInUp 0.8s ease;
}

.language-selector {
    position: absolute;
    top: 0;
    right: 0;
}

.language-selector select {
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 2rem;
    animation: fadeIn 1s ease;
}

/* Control Panel */
.control-panel, .output-panel {
    background: var(--bg-panel);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.control-panel h2, .output-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Shape Buttons */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.shape-btn {
    background: var(--bg-secondary);
    border: 2px solid transparent;
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.shape-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.shape-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
}

/* Animation Controls */
.animation-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.animation-controls label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.animation-controls select,
.animation-controls input[type="range"] {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
}

input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-secondary);
    outline: none;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
}

/* Image Upload Section */
.image-section {
    margin-top: 2rem;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 1rem;
}

.secondary-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

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

/* Preview Area */
.preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.canvas-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.preview-box {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: var(--bg-panel);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape-preview {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: clip-path 0.3s ease;
}

.canvas-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.icon-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

/* Output Panel */
.code-output {
    margin-bottom: 2rem;
}

.code-container {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
}

.code-container pre {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.copy-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Coordinates Section */
.coordinates-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.coordinate-item {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.coordinate-item span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.coordinate-item input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    width: 100%;
}

.remove-point {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-point:hover {
    transform: scale(1.2);
}

.add-point-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 500;
}

.add-point-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* Export Section */
.export-section {
    margin-top: 2rem;
}

.export-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .control-panel,
    .output-panel {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .shape-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .main-content {
        gap: 1rem;
    }
}