/* Modal Styles - DARK THEME */
.pcad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.pcad-modal-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.pcad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.pcad-modal-overlay-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.pcad-modal-content {
    position: relative;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.8);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    margin: auto;
	Top:0;
	Left:0;
}

.pcad-modal-active .pcad-modal-content {
    transform: scale(1) translateY(0);
}

.pcad-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
    background: #252525;
}

.pcad-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.pcad-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    color: #999;
}

.pcad-modal-close:hover {
    background: #333;
    color: #fff;
}

.pcad-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.pcad-modal-body-wrapper {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    background: #1e1e1e;
}

.pcad-form-tao-album {
    display: block;
}

.pcad-form-group {
    margin-bottom: 20px;
}

.pcad-form-group:last-child {
    margin-bottom: 0;
}

.pcad-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e0e0e0;
}

.pcad-form-group label .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #667eea;
}

.required {
    color: #ff6b6b;
}

.pcad-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #404040;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #2a2a2a;
    color: #e0e0e0;
    box-sizing: border-box;
}

.pcad-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: #323232;
}

.pcad-input::placeholder {
    color: #666;
}

.pcad-input-group {
    display: flex;
    gap: 10px;
}

.pcad-input-group .pcad-input {
    flex: 1;
}

.pcad-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #999;
}

.pcad-modal-footer {
    padding: 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #252525;
}

/* Buttons - DARK THEME */
.pcad-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid #404040;
    border-radius: 6px;
    background: #2a2a2a;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pcad-btn:hover {
    background: #333;
    border-color: #555;
    color: #fff;
    transform: translateY(-1px);
}

.pcad-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pcad-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
}

.pcad-btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408a 100%);
    border-color: #5568d3;
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pcad-btn-secondary {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

.pcad-btn-secondary:hover {
    background: #454545;
    border-color: #555;
}

.pcad-btn-default {
    background: transparent;
    border-color: #404040;
    color: #999;
}

.pcad-btn-default:hover {
    background: #2a2a2a;
    border-color: #555;
    color: #e0e0e0;
}

.pcad-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Image Preview - DARK THEME */
.pcad-image-preview {
    margin-top: 12px;
}

.pcad-check-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    color: #81c784;
    font-size: 14px;
    margin-bottom: 12px;
}

.pcad-check-success .dashicons {
    color: #66bb6a;
}

.pcad-check-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 6px;
    color: #ef5350;
    font-size: 14px;
}

.pcad-check-error .dashicons {
    color: #e53935;
}

.pcad-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.pcad-preview-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #404040;
    background: #2a2a2a;
}

.pcad-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.pcad-preview-item:hover img {
    transform: scale(1.05);
}

/* Loading state - DARK THEME */
.pcad-loading {
    text-align: center;
    padding: 40px 20px;
}

.pcad-loading p {
    color: #999;
    margin: 0;
}

.pcad-spinner {
    margin: 0 auto 15px;
    width: 40px;
    height: 40px;
    border: 4px solid #404040;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pcadSpin 0.8s linear infinite;
}

/* Custom Scrollbar for Modal - DARK THEME */
.pcad-modal-body-wrapper::-webkit-scrollbar {
    width: 8px;
}

.pcad-modal-body-wrapper::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.pcad-modal-body-wrapper::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.pcad-modal-body-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

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

@keyframes pcadSpin {
    to { transform: rotate(360deg); }
}

.pcad-spin {
    animation: pcadSpin 1s linear infinite;
    display: inline-block;
}

.spin {
    animation: pcadSpin 1s linear infinite;
}

/* Prevent body scroll when modal is open */
body.pcad-modal-open {
    overflow: hidden;
}

/* Tạo Album Button */
.pcad-tao-album-wrapper {
    margin: 20px 0;
}

.pcad-btn-tao-album {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pcad-btn-tao-album:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pcad-btn-tao-album .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .pcad-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .pcad-modal-header {
        padding: 15px;
    }
    
    .pcad-modal-body-wrapper {
        padding: 20px;
    }
    
    .pcad-modal-footer {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .pcad-btn {
        font-size: 13px;
        padding: 8px 14px;
    }
}
