/* 
 * Custom Case Designer CSS
 * Version: 3.1.0
 * 
 * Changelog v3.1.0:
 * - Added toast notification styles
 * - Improved responsive design
 * - Better visual feedback
 */

/* Toast Notifications Container */
#ccd-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

/* Toast Base Styles */
.ccd-toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    max-width: 350px;
    min-width: 280px;
    opacity: 0;
    overflow: hidden;
    pointer-events: all;
    position: relative;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.ccd-toast.ccd-toast-show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast Content */
.ccd-toast-content {
    align-items: center;
    display: flex;
    padding: 16px;
    position: relative;
}

.ccd-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    padding-right: 12px;
}

/* Toast Close Button */
.ccd-toast-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 20px;
    height: 24px;
    line-height: 1;
    padding: 0;
    width: 24px;
    transition: color 0.2s ease;
}

.ccd-toast-close:hover {
    color: #333;
}

/* Toast Progress Bar */
.ccd-toast-progress {
    background: rgba(0, 0, 0, 0.1);
    bottom: 0;
    height: 4px;
    left: 0;
    position: absolute;
    width: 100%;
}

/* Toast Types */
.ccd-toast-success {
    border-left: 4px solid #28a745;
}

.ccd-toast-success .ccd-toast-progress {
    background: #28a745;
}

.ccd-toast-error {
    border-left: 4px solid #dc3545;
}

.ccd-toast-error .ccd-toast-progress {
    background: #dc3545;
}

.ccd-toast-warning {
    border-left: 4px solid #ffc107;
}

.ccd-toast-warning .ccd-toast-progress {
    background: #ffc107;
}

.ccd-toast-info {
    border-left: 4px solid #17a2b8;
}

.ccd-toast-info .ccd-toast-progress {
    background: #17a2b8;
}

/* Mobile Toast Styles */
@media (max-width: 768px) {
    #ccd-toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .ccd-toast {
        max-width: 100%;
    }
}

/* Original Styles (unchanged) */
#ccd-product-base {
    width: 100%;
    height: auto;
    max-width: 100%;
}

#ccd-case-designer-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: auto;
    text-align: center;
}

#ccd-canvas-area {
    position: relative;
    width: 70%;
    height: auto;
    margin: auto;
}

#ccd-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#ccd-uploaded-image-canvas {
    width: 100%;
    height: auto;
    cursor: grab;
}

#ccd-uploaded-image-canvas:active {
    cursor: grabbing;
}

#ccd-upload-area {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ccd-custom-file-upload {
    display: inline-block;
    padding: 12px 24px;
    background-color: #ff7800;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-top: 10px;
    font-size: 16px;
}

.ccd-custom-file-upload:hover {
    background-color: #a66e00;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.ccd-custom-file-input {
    display: none;
}

#ccd-remove-image {
    display: none;
    padding: 12px 24px;
    background-color: #6c757d80;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    font-size: 18px;
}

#ccd-remove-image:hover {
    background-color: #7c858d;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#ccd-remove-image::after {
    content: '✕';
    margin-left: 8px;
    font-size: 16px;
}

.ccd-arrow {
    width: 0;
    height: 0;
    border-style: solid;
    border-color: transparent;
    position: absolute;
    pointer-events: none;
    z-index: 150;
    display: block;
}

/* Animation for ccd-arrow-up */
.ccd-arrow-up {
    border-width: 0 10px 15px 10px;
    border-bottom-color: yellow;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    animation: extract-up 2s infinite;
}

/* Animation for ccd-arrow-down */
.ccd-arrow-down {
    border-width: 15px 10px 0 10px;
    border-top-color: yellow;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    animation: extract-down 2s infinite;
}

/* Animation for ccd-arrow-left */
.ccd-arrow-left {
    border-width: 10px 15px 10px 0;
    border-right-color: yellow;
    top: 50%;
    left: 10px;
    transform: translateY(-50%) translateX(0);
    animation: extract-left 2s infinite;
}

/* Animation for ccd-arrow-right */
.ccd-arrow-right {
    border-width: 10px 0 10px 15px;
    border-left-color: yellow;
    top: 50%;
    right: 10px;
    transform: translateY(-50%) translateX(0);
    animation: extract-right 2s infinite;
}

/* Keyframes for upward extraction with color change */
@keyframes extract-up {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        border-bottom-color: #ef7b1c;
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 1;
        border-bottom-color: yellow;
    }
}

/* Keyframes for downward extraction with color change */
@keyframes extract-down {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        border-top-color: #ef7b1c;
    }
    50% {
        transform: translateX(-50%) translateY(10px);
        opacity: 1;
        border-top-color: yellow;
    }
}

/* Keyframes for leftward extraction with color change */
@keyframes extract-left {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
        border-right-color: #ef7b1c;
    }
    50% {
        transform: translateY(-50%) translateX(-10px);
        opacity: 1;
        border-right-color: yellow;
    }
}

/* Keyframes for rightward extraction with color change */
@keyframes extract-right {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
        border-left-color: #ef7b1c;
    }
    50% {
        transform: translateY(-50%) translateX(10px);
        opacity: 1;
        border-left-color: yellow;
    }
}

[itemprop="overlay"] {
    display: flex;
    flex-direction: column;
    align-items: center;
}

[itemprop="overlay"] svg {
    width: 125px;
    height: 125px;
    margin-bottom: 10px;
}

#ccd-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

#ccd-loader {
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ccd-spinner {
    border: 8px solid rgba(255, 255, 255, 0.1);
    border-top: 8px solid #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ccd-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ccd-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.ccd-modal-content h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

.ccd-modal-content p {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}

.ccd-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.ccd-close:hover,
.ccd-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#ccd-design-preview {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

.ccd-modal-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.ccd-modal-footer .btn {
    padding: 10px 20px;
    font-size: 16px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: 100%;
    max-width: 45%;
    box-sizing: border-box;
    text-align: center;
}

.ccd-modal-footer .btn-primary {
    background-color: #2e6bc6;
    color: #fff;
}

.ccd-modal-footer .btn-primary:hover {
    background-color: #1e4a9e;
    color: #f1f1f1;
}

.ccd-modal-footer .btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.ccd-modal-footer .btn-secondary:hover {
    background-color: #565e64;
    color: #f1f1f1;
}

#ccd-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    border-radius: 7px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: solid 1px #00000052;
}

#ccd-controls label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    font-size: 16px;
    color: #6e757d;
    font-weight: bold;
    position: relative;
}

#ccd-controls label span {
    font-weight: normal;
    font-size: 14px;
    color: #333;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#ccd-controls input[type="range"] {
    width: 100%;
    max-width: 500px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 5px;
    background: #6c757d80;
    outline: none;
    transition: background 0.3s ease;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
}

#ccd-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff7800;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

#ccd-controls input[type="range"]::-webkit-slider-thumb:hover {
    background: #e66e00;
    transform: scale(1.2);
}

#ccd-controls input[type="range"]:hover {
    background: #7c858d;
}

.ccd-button-container {
    padding: 5px 48px;
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 10px;
    border: solid 1px #00000052;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 7px;
}

#ccd-control-buttons {
    display: flex!important;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
}

#ccd-control-buttons svg {
    cursor: pointer;
    transition: transform 0.3s ease;
    fill: #ef7b1c;
}

#ccd-control-buttons svg:hover {
    transform: scale(1.2);
}

/* Hide controls on mobile */
@media (max-width: 768px) {
    #ccd-controls {
        display: none !important;
    }

    #ccd-color-picker-container {
        display: none !important;
    }

    #ccd-color-picker-container-mobile {
        margin-bottom: 15px;
        order: 1;
    }

    #ccd-control-buttons {
        order: 2;
    }

    #ccd-controls label[for="rotate"],
    #ccd-controls #rotate,
    #ccd-controls label[for="scale"],
    #ccd-controls #scale {
        display: none !important;
    }
}

#ccd-color-picker-container-mobile {
    display: none;
}

input[type="color"] {
    -webkit-appearance: none;
    width: 60px;
    height: 40px;
    cursor: pointer;
    border: 2px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

input[type="color"]:hover {
    border-color: #999;
    transform: scale(1.03);
}

input[type="color"]:focus {
    outline: none;
    border-color: #ff7800;
    box-shadow: 0 0 3px #ff7800;
}