/* Company Settings Modal */

#companyModal .modal-content {
    direction: rtl;
    text-align: right;
    padding: 30px;
    max-width: 550px;
    margin: 50px auto;
}

#companyModal h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #333;
}

.company-status {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.company-status.has-company {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
}

.company-status-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.company-status h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.company-code-display {
    background: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    border: 2px dashed #667eea;
}

.company-code-display button {
    margin-right: 10px;
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.company-code-display button:hover {
    background: #5568d3;
}

.company-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.company-action-btn {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #667eea;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #667eea;
}

.company-action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.company-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.company-action-btn.danger {
    border-color: #dc3545;
    color: #dc3545;
}

.company-action-btn.danger:hover {
    background: #dc3545;
    color: white;
}

.company-form {
    margin-top: 20px;
}

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

.company-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    text-align: right;
}

.company-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: right;
    direction: rtl;
    transition: border-color 0.3s;
}

.company-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.company-form-group input::placeholder {
    color: #999;
}

.company-form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.company-members-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.company-member-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.company-member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.company-member-details {
    text-align: right;
}

.company-member-email {
    font-weight: 600;
    color: #333;
}

.company-member-drive {
    font-size: 0.85rem;
    color: #666;
}

.company-member-drive.connected {
    color: #4caf50;
}

.company-member-drive.not-connected {
    color: #ff9800;
}

.back-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.back-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
    text-align: center;
}

.info-box.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* Hide views */
.company-view {
    display: none;
}

.company-view.active {
    display: block;
}

/* Drive Viewer Toggle Switch */
.drive-viewer-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.drive-viewer-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.drive-viewer-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.drive-viewer-toggle input:focus + .toggle-slider {
    box-shadow: 0 0 1px #28a745;
}

.drive-viewer-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.drive-viewer-toggle input:disabled + .toggle-slider {
    background-color: #e0e0e0;
    cursor: not-allowed;
}

/* Update member item to flex column when toggle exists */
.company-member-item {
    flex-direction: column;
    align-items: stretch;
}

.drive-viewer-toggle-container {
    width: 100%;
}
