:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #a29bfe;
    --dark: #ffffff;
    --darker: #0a0a0a;
    --light: #060707;
    --gray: #2d3436;
    --light-gray: #636e72;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    color: var(--light);
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--dark);
    box-shadow: var(--shadow);
    z-index: 10;
    border-bottom: 1px solid var(--gray);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--light);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button i {
    font-size: 0.9rem;
}

#download-btn {
    background-color: var(--primary);
    color: white;
}

#download-btn:hover {
    background-color: var(--primary-dark);
}

#download-btn:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
    opacity: 0.7;
}

#reset-btn {
    background-color: var(--gray);
    color: var(--light);
}

#reset-btn:hover {
    background-color: var(--light-gray);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: var(--dark);
    padding: 1.5rem;
    overflow-y: auto;
    border-right: 1px solid var(--gray);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--light);
}

.sidebar-section h2 i {
    font-size: 0.9rem;
    color: var(--primary);
}

.upload-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px dashed var(--gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background-color: rgba(108, 92, 231, 0.05);
}

.upload-area:hover {
    border-color: var(--primary);
    background-color: rgba(108, 92, 231, 0.1);
}

.upload-area i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.upload-area span {
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-area input {
    display: none;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--light);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-gray);
    font-size: 0.9rem;
}

.input-with-icon input {
    padding-left: 2rem;
}

input[type="text"],
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    background-color: var(--dark);
    color: var(--light);
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3);
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="color"] {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    margin-top: 0.5rem;
    -webkit-appearance: none;
    background: var(--gray);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.toggle-group {
    display: flex;
    align-items: center;
}

.toggle-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--gray);
    border-radius: 10px;
    transition: var(--transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--light);
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + .toggle-switch {
    background-color: var(--primary);
}

input[type="checkbox"]:checked + .toggle-switch::after {
    left: calc(100% - 18px);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark);
    position: relative;
    overflow: auto;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--light-gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--light);
}

.empty-state p {
    font-size: 0.9rem;
}

/* Text elements */
.text-element {
    position: absolute;
    min-width: 50px;
    min-height: 20px;
    z-index: 1000;
}

.text-element .text-content {
    outline: none;
    padding: 0.5rem;
    background-color: rgba(18, 18, 18, 0.8);
    border: 1px dashed var(--primary);
    border-radius: 4px;
    transition: var(--transition);
    color: var(--light);
}

.text-element .text-content:focus {
    border: 1px solid var(--primary);
    background-color: rgba(18, 18, 18, 0.9);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3);
}

.text-element.no-background .text-content {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    padding: 0;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    display: none;
    z-index: 1001;
    border: none;
}

.text-element:hover .delete-btn {
    display: flex;
}

/* Photo elements */
.photo-element {
    position: absolute;
    z-index: 1000;
    cursor: move;
}

.photo-element .photo-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border: 2px dashed var(--primary);
    border-radius: 4px;
    transition: var(--transition);
}

.photo-element .photo-controls {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.photo-element .photo-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    padding: 0;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    display: none;
    z-index: 1001;
    border: none;
}

.photo-element .resize-handle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border-radius: 50%;
    cursor: nwse-resize;
    pointer-events: all;
    display: none;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-element .resize-handle i {
    font-size: 10px;
    color: white;
}

.photo-element:hover .photo-delete-btn,
.photo-element:hover .resize-handle {
    display: flex;
}

.photo-element.active {
    z-index: 1001;
}

.photo-element.active .photo-img {
    border: 2px solid var(--primary-dark);
}

.photo-element.resizing {
    cursor: nwse-resize;
}

/* PDF render canvas */
canvas {
    max-width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background-color: var(--dark);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray);
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}