/**
 * Phone Case Designer - Custom CSS
 * Modern, premium design without Tailwind dependency
 */

/* Reset and Base Styles */
#pcd-app-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#pcd-app-root * {
    box-sizing: border-box;
}

/* Main Container */
.pcd-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #eff6ff 0%, #f3e8ff 100%);
    padding: 2rem 1rem;
}

.pcd-max-width {
    max-width: 1280px;
    margin: 0 auto;
}

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

.pcd-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.pcd-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
}

/* Card Styles */
.pcd-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    margin-bottom: 2rem;
}

.pcd-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
}

/* Select Dropdown */
.pcd-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5rem;
    padding-right: 3rem;
}

.pcd-select:hover {
    border-color: #9ca3af;
}

.pcd-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Case Type Grid */
.pcd-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .pcd-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .pcd-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Case Type Card */
.pcd-case-card {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.pcd-case-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pcd-case-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.pcd-case-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0.75rem 0 0.25rem 0;
    color: #111827;
}

.pcd-case-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.pcd-case-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2563eb;
    margin: 0;
}

/* Image Upload */
.pcd-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 12rem;
    border: 3px dashed #c084fc;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.pcd-upload-zone:hover {
    background: #faf5ff;
}

.pcd-upload-zone.uploading {
    opacity: 0.5;
    cursor: wait;
}

.pcd-upload-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 1rem 0 0.5rem 0;
}

.pcd-upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0;
}

.pcd-upload-size {
    font-size: 0.75rem;
    color: #2563eb;
    font-weight: 600;
    margin: 0.5rem 0 0 0;
}

/* Image Preview */
.pcd-image-preview {
    position: relative;
    width: 100%;
}

.pcd-image-preview img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    border-radius: 0.75rem;
}

.pcd-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 9999px;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcd-remove-btn:hover {
    background: #dc2626;
}

.pcd-image-info {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.pcd-image-info.valid {
    background: #10b981;
    color: white;
}

.pcd-image-info.invalid {
    background: #f59e0b;
    color: white;
}

.pcd-image-info-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Text Editor */
.pcd-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    transition: all 0.2s;
}

.pcd-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pcd-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.pcd-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .pcd-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pcd-color-input {
    width: 4rem;
    height: 3rem;
    border-radius: 0.5rem;
    border: 2px solid #d1d5db;
    cursor: pointer;
}

/* Range Slider */
.pcd-range {
    width: 100%;
    height: 0.75rem;
    background: #e5e7eb;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
    appearance: none;
}

.pcd-range::-webkit-slider-thumb {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    background: #3b82f6;
    border-radius: 9999px;
    cursor: pointer;
}

.pcd-range::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    background: #3b82f6;
    border-radius: 9999px;
    cursor: pointer;
    border: none;
}

/* Position Controls */
.pcd-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .pcd-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pcd-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pcd-btn-blue {
    background: #3b82f6;
    color: white;
}

.pcd-btn-blue:hover {
    background: #2563eb;
}

.pcd-btn-green {
    background: #10b981;
    color: white;
}

.pcd-btn-green:hover {
    background: #059669;
}

.pcd-btn-gray {
    background: #e5e7eb;
    color: #374151;
}

.pcd-btn-gray:hover {
    background: #d1d5db;
}

.pcd-position-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.pcd-position-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pcd-position-horizontal {
    display: flex;
    gap: 0.5rem;
}

.pcd-position-btn {
    padding: 0.75rem;
    background: #e5e7eb;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pcd-position-btn:hover {
    background: #d1d5db;
}

/* Preview Section */
.pcd-preview {
    position: relative;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.pcd-preview-inner {
    position: relative;
}

.pcd-canvas-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.pcd-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: 75%;
    height: auto;
    border-radius: 50px;
    image-rendering: high-quality;
}

.pcd-mockup-img {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 2;
}

.pcd-labels {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.pcd-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pcd-badge-blue {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
}

.pcd-badge-green {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    color: white;
    margin-left: 0.5rem;
}

/* Add to Cart Button */
.pcd-cart-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    width: 100%;
    max-width: 20rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.pcd-cart-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.pcd-cart-btn:active {
    transform: translateY(0);
}

/* Loading State */
.pcd-loading {
    padding: 3rem;
    text-align: center;
    color: #6b7280;
}

/* Spacing Utilities */
.pcd-mb-4 {
    margin-bottom: 1rem;
}

.pcd-mb-6 {
    margin-bottom: 1.5rem;
}

.pcd-mb-8 {
    margin-bottom: 2rem;
}

.pcd-mt-4 {
    margin-top: 1rem;
}

.pcd-mt-8 {
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .pcd-title {
        font-size: 2rem;
    }

    .pcd-card {
        padding: 1.5rem;
    }

    .pcd-container {
        padding: 1rem 0.5rem;
    }
}

/* Animation */
@keyframes pcd-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.pcd-animate-spin {
    animation: pcd-spin 1s linear infinite;
}

/* Hidden Input */
.pcd-hidden {
    display: none;
}