@keyframes spin {from {transform:rotate(0deg)} to {transform:rotate(360deg)}}
@keyframes fadeIn {from {opacity:0;transform:translateY(10px)} to {opacity:1;transform:translateY(0)}}
.hidden {display:none !important}
/* Step Sections */
.cd-step-section {display:none}
.cd-step-section.active {display:block}
#step-upload.active {display:flex;flex-direction:column;align-items:center}
/* Upload Button */
.upload-button {border:0;background-color:#4FAFFC;color:#fff;text-transform:uppercase;font-weight:700;border-radius:2em;padding:.7em 1.2em .7em 3.6em;font-size:1em;position:relative;cursor:pointer;transition:all 0.3s ease}
.upload-button:hover {background-color:#3a9ae8;transform:translateY(-2px)}
.upload-button:before {display:flex;align-items:center;justify-content:center;content:"^";font-size:1.6em;font-weight:700;background-color:#fff;color:#4FAFFC;border:1px solid currentColor;position:absolute;border-radius:50%;width:1.7em;height:1.7em;left:3px;top:0;bottom:0;margin-top:auto;margin-bottom:auto;box-shadow:0 0 0 3px #fff}
/* Status — matches Instagram tool layout (icon + text + details) */
.cd-video-status {background:#e8f5e8;border:1px solid #4caf50;border-radius:8px;padding:12px 16px;margin:10px 0;display:none;align-items:flex-start;gap:12px}
.cd-video-status.success {background:#e8f5e8;border-color:#4caf50;color:#2e7d32}
.cd-video-status.warning {background:#fff3e0;border-color:#ff9800;color:#e65100}
.cd-video-status.error {background:#ffebee;border-color:#f44336;color:#c62828}
.cd-video-status.info {background:#e3f2fd;border-color:#2196f3;color:#1565c0}
.cd-video-status .status-icon {font-size:18px;line-height:1;flex-shrink:0;margin-top:1px}
.cd-video-status .status-content {flex:1;min-width:0}
.cd-video-status .status-text {font-weight:600;margin-bottom:2px}
.cd-video-status .status-details {font-size:12px;opacity:0.85}
#hero.content-grid-mod .cd-video-status {background:rgba(255,255,255,0.1);border-color:rgba(255,255,255,0.3);color:#fff}
#hero.content-grid-mod .cd-video-status.success {background:rgba(76,175,80,0.2);border-color:rgba(76,175,80,0.5)}
#hero.content-grid-mod .cd-video-status.error {background:rgba(244,67,54,0.2);border-color:rgba(244,67,54,0.5)}
#hero.content-grid-mod .cd-video-status.warning {background:rgba(255,152,0,0.2);border-color:rgba(255,152,0,0.5)}
#hero.content-grid-mod .cd-video-status.info {background:rgba(33,150,243,0.2);border-color:rgba(33,150,243,0.5)}
/* Editor Container */
.cd-collage-editor-container {animation:fadeIn 0.3s ease;background:rgba(35,67,106,0.5);border-radius:16px;padding:18px;display:flex;gap:18px;align-items:flex-start}
/* Preview Section */
.cd-preview-section {flex:0 0 50%;min-width:0;position:sticky;top:20px;align-self:flex-start}
.cd-preview-header {display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:8px}
.cd-preview-header h3 {color:#fff;font-size:18px;font-weight:600;margin:0}
.cd-collage-info-bar {display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.cd-collage-info-bar span {font-size:12px;color:rgba(255,255,255,0.65)}
/* Collage Preview Frame */
.cd-collage-preview-frame {position:relative;background:#0f2840;border-radius:12px;padding:16px;display:flex;align-items:center;justify-content:center;min-height:200px}
#cd-collage-preview-video {display:block;max-width:100%;max-height:480px;width:auto;height:auto;border-radius:6px;transition:opacity 0.2s ease}
/* Placeholder */
.cd-collage-preview-placeholder {display:flex;flex-direction:column;align-items:center;gap:10px;color:rgba(255,255,255,0.4);text-align:center;padding:30px}
.cd-collage-preview-placeholder svg {opacity:0.4}
.cd-collage-preview-placeholder p {font-size:13px;margin:0}
/* Preview Loading Spinner */
.cd-preview-loading {position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:linear-gradient(135deg,rgba(0,0,0,0.22),rgba(0,0,0,0.38));border-radius:12px;z-index:2;backdrop-filter:blur(2px)}
.cd-preview-loading.active {display:flex}
.cd-preview-spinner {width:32px;height:32px;border:3px solid rgba(255,255,255,0.25);border-top-color:#4FAFFC;border-radius:50%;animation:spin 0.8s linear infinite;box-shadow:0 0 8px rgba(0,0,0,0.4)}
/* Controls Column */
.cd-controls-column {flex:1;min-width:0;display:flex;flex-direction:column;gap:12px;width:100%}

/* 2-col sub-column grid pairing Layout + Background (mirrors Instagram tool's .cd-igm-controls-grid) */
.cd-collage-controls-grid {display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
.cd-collage-controls-grid > .cd-layout-section,
.cd-collage-controls-grid > .cd-bg-color-section {min-width:0}

/* Current Selection chip — mirrors Instagram's "Converting to:" line */
.cd-collage-current-selection {display:flex;align-items:center;gap:8px;padding:8px 12px;background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.18);border-radius:8px}
.cd-collage-current-selection .cd-selection-label {font-size:12px;color:rgba(255,255,255,0.7)}
.cd-collage-current-selection .cd-selection-value {font-weight:600;color:#fff;font-size:13px}

/* Result Info card — mirrors Instagram's .cd-igm-result-info */
.cd-collage-result-info {background:#1a3a5c;border-radius:10px;padding:10px 12px}
.cd-collage-result-info .cd-info-row {display:flex;justify-content:space-between;align-items:center;padding:5px 0;border-bottom:1px solid rgba(255,255,255,0.1);gap:10px}
.cd-collage-result-info .cd-info-row:last-child {border-bottom:none}
.cd-collage-result-info .cd-info-label {color:rgba(255,255,255,0.7);font-size:12px}
.cd-collage-result-info .cd-info-value {color:#fff;font-size:12px;font-weight:500;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
/* Section Header */
.cd-section-header {display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.cd-section-header h4 {color:#fff;font-size:14px;font-weight:600;margin:0}
/* Videos Section */
.cd-videos-section {background:#1a3a5c;border-radius:10px;padding:10px 12px}
.cd-count-badge {font-size:12px;font-weight:400;color:rgba(255,255,255,0.6)}
.cd-add-btn {display:inline-flex;align-items:center;gap:4px;padding:4px 10px;background:rgba(79,175,252,0.15);border:1px solid rgba(79,175,252,0.4);border-radius:6px;color:#4FAFFC;font-size:12px;cursor:pointer;transition:all 0.2s ease}
.cd-add-btn:hover {background:rgba(79,175,252,0.25);border-color:#4FAFFC}
.cd-uploaded-videos-list {display:flex;flex-direction:column;gap:6px;margin-top:8px}
/* Video Item */
.cd-video-item {display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.06);border-radius:8px;padding:8px 10px}
.cd-video-item-icon {flex:0 0 auto;color:#4FAFFC;display:flex;align-items:center}
.cd-video-item-info {flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.cd-video-item-name {font-size:12px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cd-video-item-meta {font-size:11px;color:rgba(255,255,255,0.45)}
.cd-remove-video-btn {flex:0 0 auto;background:transparent;border:none;color:rgba(255,255,255,0.4);font-size:16px;cursor:pointer;padding:0 4px;line-height:1;transition:color 0.2s ease}
.cd-remove-video-btn:hover {color:#f44336}
.cd-input-hint {font-size:11px;color:rgba(255,255,255,0.4);margin:6px 0 0;text-align:center}
/* Layout Section */
.cd-layout-section {background:#1a3a5c;border-radius:10px;padding:10px 12px}
.cd-layout-grid {display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.cd-layout-btn {padding:10px 6px;background:rgba(255,255,255,0.06);border:2px solid rgba(255,255,255,0.12);border-radius:8px;color:rgba(255,255,255,0.75);cursor:pointer;transition:all 0.2s ease;display:flex;flex-direction:column;align-items:center;gap:5px}
.cd-layout-btn:hover {background:rgba(79,175,252,0.1);border-color:rgba(79,175,252,0.4);color:#fff}
.cd-layout-btn.active {background:rgba(79,175,252,0.15);border-color:#4FAFFC;color:#fff}
.cd-layout-label {font-size:11px;font-weight:600;text-align:center;line-height:1.2}
.cd-layout-desc {font-size:10px;opacity:0.6}
/* Layout Icons */
.cd-layout-icon {width:40px;height:28px;display:grid;gap:2px;border-radius:3px;overflow:hidden}
.cd-layout-icon div {background:rgba(79,175,252,0.5);border-radius:2px}
.cd-layout-btn.active .cd-layout-icon div {background:#4FAFFC}
.cd-layout-side-by-side {grid-template-columns:1fr 1fr;grid-template-rows:1fr}
.cd-layout-stacked {grid-template-columns:1fr;grid-template-rows:1fr 1fr}
.cd-layout-grid-2x2 {grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
/* Background Color Section */
.cd-bg-color-section {background:#1a3a5c;border-radius:10px;padding:10px 12px}
.cd-color-row {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cd-color-picker {width:36px;height:36px;border:none;border-radius:6px;padding:2px;cursor:pointer;background:transparent}
.cd-color-text-input {width:90px;padding:6px 8px;background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.2);border-radius:6px;color:#fff;font-size:12px;font-family:monospace}
.cd-color-text-input:focus {outline:none;border-color:#4FAFFC}
.cd-bg-color-presets {display:flex;gap:5px}
.cd-color-preset {width:24px;height:24px;border-radius:4px;cursor:pointer;transition:transform 0.15s ease}
.cd-color-preset:hover {transform:scale(1.15)}
/* Buttons Row */
.cd-buttons-row {display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}
/* Primary action buttons share the same cyan gradient — within-tool color consistency */
.cd-generate-btn,.cd-download-btn {display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:11px 24px;background:linear-gradient(135deg,#48C4D8,#4FAFFC);border:none;border-radius:8px;color:#fff;font-size:13px;font-weight:600;cursor:pointer;transition:all 0.3s ease;box-shadow:0 2px 8px rgba(79,175,252,0.3);text-decoration:none}
.cd-generate-btn:hover,.cd-download-btn:hover {transform:translateY(-1px);box-shadow:0 4px 12px rgba(79,175,252,0.4);color:#fff}
.cd-generate-btn svg,.cd-download-btn svg {flex-shrink:0}
.cd-start-over-section {display:flex}
.cd-start-over-btn {padding:8px 16px;background:transparent;border:1px solid rgba(255,255,255,0.3);border-radius:8px;color:rgba(255,255,255,0.7);font-size:13px;cursor:pointer;transition:all 0.3s ease}
.cd-start-over-btn:hover {border-color:rgba(255,255,255,0.6);color:#fff}
/* Loader */
.cd-tool-file-preview-wrapper {display:none}
.cd-tool-file-preview-wrapper.active {display:flex;align-items:center;justify-content:center}
.cd-tool-preview-loader {display:flex;flex-direction:column;align-items:center;gap:15px;padding:30px}
.cd-tool-preview-loader[data-loader-view="full"] {position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(17,17,17,0.9);z-index:9999;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(5px)}
.cd-tool-preview-loader img {width:50px;height:50px;animation:spin 1s infinite linear}
.cd-tool-preview-loader span {color:#fff;font-size:16px;font-weight:500}
/* Upload hint */
.cd-upload-hint {font-size:13px;color:rgba(255,255,255,0.6);margin:8px auto 0}
/* Hero Overrides */
#hero.content-grid-mod::before {background:radial-gradient(circle,rgba(0,101,173,1) 0%,rgba(3,31,51,1) 82%);background-size:300vw;background-repeat:no-repeat;background-position:right bottom;height:70%}
#hero.content-grid-mod::after {content:"";position:absolute;left:0;right:0;bottom:0;top:auto;margin:auto;height:30%;background-color:#0D1E32;background-image:url("../../../../assets/img/clouds.svg");background-size:700px;background-repeat:no-repeat;background-position:-360px -370px}
#hero.content-grid-mod {border-bottom:0;z-index:99}
#hero.content-grid-mod .converter-wrapper {background-color:#23436A;padding:50px;border-radius:24px;margin-top:76px;transition:height 0.3s ease-out}
.preview-active#hero.content-grid-mod .converter-wrapper.video-collage-maker-wrapper {padding:30px;max-width:100%;width:100%}
#hero.content-grid-mod .converter-wrapper .drop-area {background-color:#355A90;border-radius:16px;padding:50px 60px;height:auto;margin:0 auto 40px;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px solid transparent;transition:all 0.3s ease}
#hero.content-grid-mod .converter-wrapper .drop-area.highlight {box-shadow:0 10px 20px rgba(0,0,0,0.2);border:2px solid #4FAFFC}
#hero.content-grid-mod .converter-wrapper .drop-area h2 {font-weight:300;font-size:42px;color:#fff;margin-bottom:30px;line-height:1.2;text-align:center}
#hero.content-grid-mod .converter-wrapper .drop-area p {font-size:16px;color:#fff;line-height:1.5;font-family:"Inter",sans-serif;margin:16px auto}
#hero.content-grid-mod .converter-wrapper .drop-area::before {content:"";display:flex;height:80px;width:80px;background-image:url("../../../../assets/img/upload.svg");background-size:contain;background-repeat:no-repeat;background-position:center;margin-bottom:20px}
/* Top Bar */
#hero .cd_header_top_bar {display:none}
.cd_header_top_bar {width:100%;background:#3f5fff;color:#fff;display:flex;align-items:center;justify-content:center;padding:10px 30px;height:auto;z-index:99;position:relative;font-size:14px}
.cd_header_top_bar .cd_header_top_bar_content a {color:#fff;text-transform:uppercase;text-decoration:underline;margin-left:8px}
/* Responsive */
@media (max-width:1199px) {
.cd-collage-editor-container {flex-direction:column}
.cd-preview-section {position:static;flex:none;width:100%}
}
@media (max-width:991px) {
#hero.content-grid-mod .converter-wrapper {padding:25px}
.preview-active#hero.content-grid-mod .converter-wrapper.video-collage-maker-wrapper {padding:20px}
.cd-collage-editor-container {padding:15px}
}
@media (max-width:767px) {
#hero.content-grid-mod .converter-wrapper {padding:15px;margin-top:40px;border-radius:12px}
.preview-active#hero.content-grid-mod .converter-wrapper.video-collage-maker-wrapper {padding:12px}
#hero.content-grid-mod .converter-wrapper .drop-area {padding:25px 20px}
#hero.content-grid-mod .converter-wrapper .drop-area h2 {font-size:24px;margin-bottom:20px}
#hero.content-grid-mod .converter-wrapper .drop-area::before {height:60px;width:60px}
.cd-collage-editor-container {padding:12px;gap:14px}
.cd-collage-controls-grid {grid-template-columns:1fr;gap:10px}
.cd-preview-header {flex-direction:column;align-items:flex-start}
#cd-collage-preview-video {max-height:300px}
.cd-buttons-row {flex-direction:column;align-items:stretch}
.cd-generate-btn,.cd-download-btn,.cd-start-over-btn {width:100%;justify-content:center;text-align:center}
.cd_header_top_bar {padding:10px 16px;font-size:13px;text-align:center}
}
@media (max-width:575px) {
.cd-layout-grid {grid-template-columns:repeat(3,1fr)}
.cd-layout-btn {padding:8px 4px}
.cd-layout-label {font-size:10px}
.cd-layout-desc {display:none}
#cd-collage-preview-video {max-height:220px}
}
