/**
 * Modal Styles - Material Design
 * Authentication modal and projects modal
 */

/* Authentication Modal */
#authModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.87);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#authModal > div {
    background: rgba(30,30,30,0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 16px;
    width: 420px;
    border: 1px solid var(--md-divider);
    /* Material Design elevation dp24 */
    box-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),
                0px 24px 38px 3px rgba(0,0,0,0.14),
                0px 9px 46px 8px rgba(0,0,0,0.12);
}

#authModal h2 {
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 400;
    color: var(--md-text-high);
}

#authModal p {
    margin-bottom: 25px;
    color: var(--md-text-medium);
    font-size: 14px;
}

#authModal input {
    width: 100%;
    margin: 12px 0;
    padding: 16px;
    background: rgba(255,255,255,0.09);
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.42);
    border-radius: 4px 4px 0 0;
    color: #fff;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    outline: none;
    transition: background-color 200ms cubic-bezier(0.0, 0, 0.2, 1),
                border-color 200ms cubic-bezier(0.0, 0, 0.2, 1);
}

#authModal input:hover {
    background: rgba(255,255,255,0.13);
    border-bottom-color: rgba(255,255,255,0.87);
}

#authModal input:focus {
    border-bottom: 2px solid var(--md-primary);
    background: rgba(255,255,255,0.13);
    padding-bottom: 15px;
}

#authModal button {
    width: 100%;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.25px;
    background: var(--md-primary);
    color: #000000;
    transition: background-color 280ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
    /* Material Design elevation dp2 */
    box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),
                0px 2px 2px 0px rgba(0,0,0,0.14),
                0px 1px 5px 0px rgba(0,0,0,0.12);
}

#authModal button:hover {
    background: var(--md-primary-dark);
    /* Material Design elevation dp4 */
    box-shadow: 0px 2px 4px -1px rgba(0,0,0,0.2),
                0px 4px 5px 0px rgba(0,0,0,0.14),
                0px 1px 10px 0px rgba(0,0,0,0.12);
}

#authError {
    display: none;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 8px;
    color: #ef5350;
    font-size: 13px;
}

/* Projects Modal */
#projectsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

#projectsModal > div {
    background: linear-gradient(145deg, rgba(30,30,30,0.98), rgba(20,20,20,0.98));
    padding: 40px;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-height: 80vh;
    overflow-y: auto;
}

#projectsModal h2 {
    margin: 0;
    font-size: 26px;
    background: linear-gradient(135deg, #ffffff 0%, #999999 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Save/Publish Modal */
#savePublishModal, #campaignModal, #emailModal, #adModal, #adGalleryModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.90);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(145deg, rgba(30,30,30,0.98), rgba(20,20,20,0.98));
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    width: 500px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 30px 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #999999 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-modal-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.modal-body {
    padding: 25px 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Save Options */
.save-option {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 14px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.checkbox-description {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* Form Elements */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}

.text-input, .textarea-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.text-input:focus, .textarea-input:focus {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.08);
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    color: #000;
    box-shadow: 0 4px 16px rgba(255,255,255,0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,255,255,0.3);
}

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

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.4);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    text-align: center;
}

/* Email Template Modal Specific Styles */
.email-modal {
    max-width: 560px;
}

.select-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
}

.select-input:hover {
    background: rgba(255,255,255,0.08);
}

.select-input:focus {
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.08);
}

.select-input option {
    background: #1a1a1a;
    color: #fff;
}

/* Ad Modal specific styles */
.ad-modal {
    max-width: 600px;
}

/* Ad Gallery Modal */
.ad-gallery-modal {
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.ad-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.ad-gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    transition: transform 0.2s;
}

.ad-gallery-item:hover {
    transform: scale(1.02);
}

.ad-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-format-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ad-download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.ad-gallery-item:hover .ad-download-btn {
    opacity: 1;
}
